STINNER Victor added the comment: Hi Giampaolo Rodola'! It seems like you proposed the same idea 4 years ago and I wrote a similar patch: issue #18932 :-)
I suggest you to use my perf module to produce more reliable benchmarks. Here is my results on my computer smithers tuned for benchmarks: haypo@smithers$ ./python bench_selectors.py -o ref.json [apply the patch] haypo@smithers$ ./python bench_selectors.py -o patch.json haypo@smithers$ ./python -m perf compare_to ref.json patch.json --table +----------------------+---------+------------------------------+ | Benchmark | ref | patch | +======================+=========+==============================+ | PollSelector.modify | 11.3 us | 8.22 us: 1.37x faster (-27%) | +----------------------+---------+------------------------------+ | EpollSelector.modify | 13.5 us | 8.88 us: 1.52x faster (-34%) | +----------------------+---------+------------------------------+ Not significant (1): SelectSelector.modify @neologix: "Hm, do you have a realistic benchmark which would show the benefit?" I don't think that selector.modify() can be a bottleneck, but IMHO the change is simple and safe enough to be worth it. In a network server with 10k client, an optimization making .modify() 1.52x faster is welcomed. ---------- Added file: http://bugs.python.org/file46789/bench_selectors_modify.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30014> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com