Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.25x speedup on the standard benchmark suite. See Faster CPython for details.
刚发布的新版本 3.11 对比 3.10 性能提升很多,这个版本增加一个语法特性:
- PEP 654: Exception Groups and except*.
4 个新的类型推断特性:
- PEP 646: Variadic generics.
- PEP 655: Marking individual TypedDict items as required or potentially-missing.
- PEP 673: Self type.
- PEP 675: Arbitrary literal string type.
以及安全提升。下面是几个测试结果:
正则表达式编译:
django 模板速度:
综合测试结果: