[Python-Dev] Python 3.3 vs. Python 2.7 benchmark results (again, but this time more solid numbers)

Philip Jenvey pjenvey at underboss.org
Fri Nov 2 19:16:25 CET 2012


On Oct 26, 2012, at 12:14 PM, Brett Cannon wrote:

> 
> Worst benchmark is nosite_startup, best is telco. The benchmarks people might want to analyze (i.e. more than 20% slower in Python 3.3) are mako_v2, threaded_count, normal_startup, iterative_count, pathlib, formatted_logging, and simple_logging.

> 
> ### mako_v2 ###
> Min: 0.083660 -> 0.243323: 2.91x slower
> Avg: 0.084634 -> 0.247875: 2.93x slower
> Significant (t=-821.55)
> Stddev: 0.00193 -> 0.00400: 2.0737x larger
> Timeline: b'http://tinyurl.com/98n9fab'

So Mike Bayer and I narrowed down mako_v2's slowness to use of an inline re

This:

http://www.makotemplates.org/trac/changeset/c1468b12f115ac9e469150ce24ea042aeae5e270

brings it down to around:

### mako_v2 ###
Min: 0.087608 -> 0.066748: 1.31x faster
Avg: 0.091348 -> 0.071224: 1.28x faster
Significant (t=26.10)
Stddev: 0.00312 -> 0.00447: 1.4340x larger
Timeline: http://tinyurl.com/as2zedo

The culprit is the lru_cache on re._compile_typed. Notice functools' numbers from the profiler:

http://paste.ofcode.org/yZRKnJfTsHesFR8hMWfc7f

Mike also noticed that the mako fix above does nothing to 2.7's numbers.

--
Philip Jenvey


More information about the Python-Dev mailing list