
While hacking on an XML pickler, I found that pickle.py got nearly twice as fast in 2.2 comparing to 2.1 and 2.0. The code in pickle.py doesn't seem to have changed much. Anybody know where that speedup came from ? Can somebody on another (non-Linux) system please verify this. Thanks, -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/

"M.-A. Lemburg" wrote:
Nevermind; it was the change in pickle.py to use cStringIO instead of StringIO that caused the difference. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/

While hacking on an XML pickler, I found that pickle.py got nearly twice as fast in 2.2 comparing to 2.1 and 2.0.
What benchmark?
I believe DOM nodes are now new-style classes, for better or for worse (it might create problems when combining with classic mixins). Could that explain it? --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum wrote:
I was looking at the roundtrip speed of pickling a list of integers.
No. I'm writing my own little beast here which does not use DOM, expat or sgmlop. The results of the approach which tries to avoid Python function calls are interesting. I moved from the usual switch strategy of dispatching to instance methods to a large for-loop with lots of "if x is y: ...". While I suspected the latter to be faster on average, I found that this is not the case. I still have to investigate where the performance goes, but the result kind of surprised me. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/

Sorry, it's too early for me to understand what the two alternatives are. :-) --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum writes:
Using minidom specifically, NodeList objects are new-style, but the Nodes are still all old-style. The __getattr__/__setattr__ stuff has all been replaced with property-based implementation as well. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation

"M.-A. Lemburg" wrote:
Nevermind; it was the change in pickle.py to use cStringIO instead of StringIO that caused the difference. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/

While hacking on an XML pickler, I found that pickle.py got nearly twice as fast in 2.2 comparing to 2.1 and 2.0.
What benchmark?
I believe DOM nodes are now new-style classes, for better or for worse (it might create problems when combining with classic mixins). Could that explain it? --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum wrote:
I was looking at the roundtrip speed of pickling a list of integers.
No. I'm writing my own little beast here which does not use DOM, expat or sgmlop. The results of the approach which tries to avoid Python function calls are interesting. I moved from the usual switch strategy of dispatching to instance methods to a large for-loop with lots of "if x is y: ...". While I suspected the latter to be faster on average, I found that this is not the case. I still have to investigate where the performance goes, but the result kind of surprised me. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/

Sorry, it's too early for me to understand what the two alternatives are. :-) --Guido van Rossum (home page: http://www.python.org/~guido/)

Guido van Rossum writes:
Using minidom specifically, NodeList objects are new-style, but the Nodes are still all old-style. The __getattr__/__setattr__ stuff has all been replaced with property-based implementation as well. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
participants (3)
-
Fred L. Drake, Jr.
-
Guido van Rossum
-
M.-A. Lemburg