Message287345
For the worst case the drawback is significant:
$ ./python -m perf timeit -s "s = set('a%s' % i for i in range(100))" -- "s.add('test'); s.discard('test')"
Unpatched: Median +- std dev: 861 ns +- 82 ns
Patched: Median +- std dev: 2.81 us +- 0.18 us
How large the benefit in the best case? I can't get any significant difference.
$ ./python -m perf timeit -s "a = ['a%s' % i for i in range(1000)]" -- "set(a)"
Unpatched: Median +- std dev: 130 us +- 6 us
Patched: Median +- std dev: 127 us +- 8 us |
|
Date |
User |
Action |
Args |
2017-02-08 16:03:26 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, tim.peters, rhettinger, methane |
2017-02-08 16:03:26 | serhiy.storchaka | set | messageid: <1486569806.16.0.103540022494.issue29476@psf.upfronthosting.co.za> |
2017-02-08 16:03:26 | serhiy.storchaka | link | issue29476 messages |
2017-02-08 16:03:26 | serhiy.storchaka | create | |
|