[Python-3000] Performance Notes (original) (raw)

Guido van Rossum guido at python.org
Tue Sep 4 05:16:43 CEST 2007


Interesting! Thanks for doing this. We'll need a lot of this over the coming year.

I read in this that the increased cost is largely due to using unicode strings for all variable and attribute names. So the next step might be to optimize the snot out of unicode hashing and introduce the unicode equivalent of lookup_string (while retiring the 8-bit version). The unicode type has never received the same amount of love that the 8-bit str type received over the years (and from day zero).

BTW this goes to show that int operations are not (yet) the biggest bottleneck -- though I'm sure they're bubbling under.

PS It would be interesting to collect more "holistic" benchmarks (micro-benchmarks aren't particularly interesting in this stage, as we're trying to improve overall performance).

--Guido

On 9/3/07, Nicholas Bastin <nick.bastin at gmail.com> wrote:

I've been doing some profiling of 3.0 vs. 2.6 release builds on Windows XP for the purpose of hopefully closing the performance gap. This data is very preliminary, but I thought I'd throw it out here in case someone else also wanted to look into this. Also, possibly useful for comparing against profiling data on other platforms. The table below just lists functions and speed differentials in 3.0 vs. 2.6, ordered by the functions in which we spend the most total time.

NOTE: This data is time sampling, not call graph. Added time could come from either more calls, or longer calls. + 11.5% PyEvalEvalFrameEx + 40.2% lookdict (replacing lookdictstring) +312.9% PyDictGetItem - 13.2% callfunction + 19.4% fastfunction Other notes: * PyLongFitsInLong consumes about 2% of total pystone runtime. * unicodecompare consumes the exact same time in 3.0 that stringrichcompare consumed in 2.6. Either these functions share a similar CPU profile, or their call counts vary dramatically. Top 5 functions in Python 2.6: * PyEvalEvalFrameEx (48.66%) * lookdictstring (5.76%) * callfunction (4.80%) * framedealloc (2.80%) * fastfunction (2.48%) Top 5 functions in Python 3.0: * PyEvalEvalFrameEx (44.37%) * lookdict (6.66%) * PyDictGetItem (4.63%) * unicodehash (3.51%) * callfunction (3.38%) -- Nick


Python-3000 mailing list Python-3000 at python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-3000 mailing list