Message291266
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. |
|
Date |
User |
Action |
Args |
2017-04-07 12:24:37 | vstinner | set | recipients:
+ vstinner, gvanrossum, giampaolo.rodola, neologix, yselivanov |
2017-04-07 12:24:37 | vstinner | set | messageid: <1491567877.48.0.947926348403.issue30014@psf.upfronthosting.co.za> |
2017-04-07 12:24:37 | vstinner | link | issue30014 messages |
2017-04-07 12:24:37 | vstinner | create | |
|