Re: [Zope-dev] Re: Speed win in Python's urllib.quote
(zope3-dev trimmed) Hi Tres, Tres Seaver wrote: On further consideration (and after some more profiling), I would actually prefer inlining the speedup code directly into OFS.Traversable.Traversable, to remove the extra function call as well as to avoid the gnarliness of monkey-patching Python. Fair enough :-) An alternative would be to call 'quote' only once (for the completed string), rather than repeatedly (for each path element). Wouldn't that then encode all the /'es? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: [Zope3-dev] Re: Speed win in Python's urllib.quote
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Actually, this is public : http://public.dev.nuxeo.com/~ben/funkload/ :) J. Martijn Pieters wrote: > Martijn Pieters wrote: > >>Is this site ment to be public? The name doesn't resolve for me. Is the >>head from http://svn.nuxeo.org/trac/pub/browser/funkload/ sufficient? > > > Reply to self: in the zope3 list the answer to the above question has > been found; it was "Yes". > > Martijn Pieters > > > ___ > Zope-Dev maillist - Zope-Dev@zope.org > http://mail.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope ) - -- Julien Anguenot | Nuxeo R&D (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFDJqEDGhoG8MxZ/pIRAgCfAJ9yNblBWJ9s9iTYHWGqsObcXZHP1gCfR2Xh /nLeoaYhJazqtKi2ELStO04= =Wod1 -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Speed win in Python's urllib.quote
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: > Tres Seaver wrote: > >> On further consideration (and after some more profiling), I would >> actually prefer inlining the speedup code directly into >> OFS.Traversable.Traversable, to remove the extra function call as well >> as to avoid the gnarliness of monkey-patching Python. > > Fair enough :-) > >> An alternative >> would be to call 'quote' only once (for the completed string), rather >> than repeatedly (for each path element). > > Wouldn't that then encode all the /'es? No -- urllib.quote takes a 'safe' argument, which defaults to '/', as an extension to the 'always_safe' set:: $ python2.3 Python 2.3.5 (#2, Aug 30 2005, 13:43:24) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from urllib import quote >>> quote('/abc/def/ghi') '/abc/def/ghi' Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] 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 iD8DBQFDJqPx+gerLs4ltQ4RAqI4AKDEP6eiq/IzrYISuYM1AbJYAWQvWwCfXCYE 7AXqhMubzcfedZwO0Gr77x8= =o9gI -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )