Message71126
Hello Matt,
> OK I implemented the defaultdict solution. I got curious so ran some
> rough speed tests, using the following code.
>
> import random, urllib.parse
> for i in range(0, 100000):
> str = ''.join(chr(random.randint(0, 0x10ffff)) for _ in range(50))
> quoted = urllib.parse.quote(str)
I think if you move the line defining "str" out of the loop, relative timings
should change quite a bit. Chances are that the random functions are not very
fast, since they are written in pure Python.
Or you can create an inner loop around the call to quote(), for example to
repeat it 100 times.
cheers
Antoine. |
|
Date |
User |
Action |
Args |
2008-08-14 13:07:24 | pitrou | set | recipients:
+ pitrou, gvanrossum, loewis, jimjjewett, janssen, orsenthil, thomaspinckney3, mgiuca |
2008-08-14 13:07:23 | pitrou | link | issue3300 messages |
2008-08-14 13:07:23 | pitrou | create | |
|