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 serhiy.storchaka
Recipients methane, rhettinger, serhiy.storchaka, tim.peters
Date 2017-02-08.16:03:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486569806.16.0.103540022494.issue29476@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2017-02-08 16:03:26serhiy.storchakasetrecipients: + serhiy.storchaka, tim.peters, rhettinger, methane
2017-02-08 16:03:26serhiy.storchakasetmessageid: <1486569806.16.0.103540022494.issue29476@psf.upfronthosting.co.za>
2017-02-08 16:03:26serhiy.storchakalinkissue29476 messages
2017-02-08 16:03:26serhiy.storchakacreate