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 vstinner
Recipients giampaolo.rodola, gvanrossum, neologix, vstinner, yselivanov
Date 2017-04-07.12:24:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491567877.48.0.947926348403.issue30014@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-04-07 12:24:37vstinnersetrecipients: + vstinner, gvanrossum, giampaolo.rodola, neologix, yselivanov
2017-04-07 12:24:37vstinnersetmessageid: <1491567877.48.0.947926348403.issue30014@psf.upfronthosting.co.za>
2017-04-07 12:24:37vstinnerlinkissue30014 messages
2017-04-07 12:24:37vstinnercreate