Message38694
Logged In: YES
user_id=52562
update:
I did a real app benchmark of this patch by running one of
the unit tests from
PyXML-0.6.6. (Which one? The one that I guessed would
favor my optimization
the most. Unfortunately I've lost my notes and I don't
remember which one.)
I also separated out the "unroll strcmp" optimization from
the "use macros"
optimization on request.
I have lost my notes, but I recall that my results showed
what I expected:
between 0.5 and 3 percent app-level speed-up for the unroll
strcmp optimization.
Interesting detail: a quirk in GCC 3 makes the unroll strcmp
version is slightly
faster than the current strcmp version *even* in the
(common) case that the
first two characters of the attribute name are *not* '__'.
What should happen next:
1. Someone who has the authority to approve or reject this
patch should tell me
what kind of benchmark would be persuasive to you. I mean:
what specific
program I can run with and without my patch for a useful
comparison. (If you
require more than a 5% app-level speed-up, then let's give
up on this patch now!)
2. Someone volunteer to test this patch with MSFT compiler,
as I don't have one
right now. Some people are still using the Windows
platform, I've noticed [1],
so it is worth benchmarking. Actually, someone should
volunteer to benchmark
GCC+Linux-or-MacOSX, too, as my computer is a laptop with
variable-speed CPU and
is really crummy for benchmarking.
By the way, PEP 266 is a better solution to the problem but
until it's
implemented, this patch is the better patch. ;-)
Note: this is one of those patches that looks uglier in
"diff -u" format than in
actual source code. Please browse the actual source
side-by-side [2] to see how
ugly it really is.
Regards
Zooko
[1] http://www.google.com/press/zeitgeist/jan02-pie.gif
[2] search for "class_getattr" in:
http://zooko.com/classobject.c
http://zooko.com/classobject-strcmpunroll.c
---
zooko.com
Security and Distributed Systems Engineering
---
|
|
Date |
User |
Action |
Args |
2007-08-23 15:10:31 | admin | link | issue502415 messages |
2007-08-23 15:10:31 | admin | create | |
|