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 <>
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 -o ref.json
[apply the patch]
haypo@smithers$ ./python -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:37vstinnersetrecipients: + vstinner, gvanrossum, giampaolo.rodola, neologix, yselivanov
2017-04-07 12:24:37vstinnersetmessageid: <>
2017-04-07 12:24:37vstinnerlinkissue30014 messages
2017-04-07 12:24:37vstinnercreate