Message163420
This bug is still present in Python 3.3. Some people use urlsafe strings *a lot*. And they find that the (obvious) implementation in base64.py is way too slow. In fact, I found myself writing the following a few times in App Engine libraries:
# This is 3-4x faster than urlsafe_b64decode()
urlsafe = base64.b64encode(<arg>)
return urlsafe.rstrip('=').replace('+', '-').replace('/', '_')
Someone from YouTube told me they patch the stdlib for the same reason (they claim their solution is 10x faster).
IIUC the cause of the slowness is the (mostly irrelevant) generality in b64encode and the _translate() function. |
|
Date |
User |
Action |
Args |
2012-06-22 15:00:00 | gvanrossum | set | recipients:
+ gvanrossum |
2012-06-22 15:00:00 | gvanrossum | set | messageid: <1340377200.19.0.907616925756.issue15138@psf.upfronthosting.co.za> |
2012-06-22 14:59:59 | gvanrossum | link | issue15138 messages |
2012-06-22 14:59:58 | gvanrossum | create | |
|