This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ajaksu2
Recipients ajaksu2, jepler, rhettinger, tseaver
Date 2008-04-08.18:41:23
SpamBayes Score 0.08265377
Marked as misclassified No
Message-id <1207680085.71.0.987169754185.issue1285086@psf.upfronthosting.co.za>
In-reply-to
Content
This is what I found doing some timings:

For the short-circuit path, the regexp can make quote 10x as fast in
exceptional cases, even comparing to the faster version in trunk. The
average win for short-circuit seems to be twice as fast as the map in my
timings. This sounds good.

For the normal path, the overhead can make quote 50% slower. This IMHO
makes it unfit for quote replacement. Perhaps good for a cookbook recipe? 

Regarding the OP's use case, I believe either adding a string cache to
quote or flagging stored strings as "safe" or "must quote" would result
in a much greater impact on performance.

Attaching patch against trunk. Web framework developers should be
interested in testing this and could provide the use cases/data needed
for settling this issue.
History
Date User Action Args
2008-04-08 18:41:26ajaksu2setspambayes_score: 0.0826538 -> 0.08265377
recipients: + ajaksu2, jepler, rhettinger, tseaver
2008-04-08 18:41:25ajaksu2setspambayes_score: 0.0826538 -> 0.0826538
messageid: <1207680085.71.0.987169754185.issue1285086@psf.upfronthosting.co.za>
2008-04-08 18:41:24ajaksu2linkissue1285086 messages
2008-04-08 18:41:23ajaksu2create