[Zope-dev] Speed win in Python's urllib.quote

Tres Seaver tseaver at palladion.com
Thu Sep 8 13:05:27 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

While profiling a page full of dynamically-generated links, I was
interested to see Python's 'urllib._fast_quote' show up quite high in
the total time list.  After looking at it, I have found a pretty huge
speed win available, posted to Python's SF tracker as bug #1285086:


https://sourceforge.net/tracker/index.php?func=detail&aid=1285086&group_id=5470&atid=105470

Zope makes *heavy* use of urllib.quote (quoting each element of the path
in 'absolute_url', for instance), which makes it a particularly
interesting speedup for us.

I'm attaching the speed test and the patch, for consideration by the
Zope development community:  if this is enough of a win, we might
consider including a patched urllib in Zope2/Zope3 (or monkey-patching
urllib.quote).

Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDIG9X+gerLs4ltQ4RArBaAJwIWac5xvHjmQg2S3oXXIFWzrecjACghGuw
5NnQQGNw55JDWjrzRyCEitA=
=iIpp
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: urllib_fast_quote_speed_test.py
Type: application/x-httpd-cgi
Size: 1718 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20050908/794c7339/urllib_fast_quote_speed_test.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: urllib_faster_quote.patch
Type: text/x-patch
Size: 2038 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20050908/794c7339/urllib_faster_quote.bin


More information about the Zope-Dev mailing list