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 jimmylai
Recipients jimmylai, yselivanov
Date 2017-09-05.17:19:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504631975.49.0.0715054245706.issue31350@psf.upfronthosting.co.za>
In-reply-to
Content
get_event_loop() and _get_running_loop() can be faster.

Case	Time	Mean	Improve																						
No Change	7.323 +- 0.172	7.323	0.00%																						
Remove class _RunningLoop	6.513 +- 0.115	6.513	-11.06%																						
Expand _get_running_loop() inside get_event_loop()	5.851 +- 0.160	5.851	-20.10%																						
Use Tuple instead of two attributes	6.179 +- 0.099	6.179	-15.62%																						
Tuple + Remove _RunningLoop	6.026 +- 0.123	6.026	-17.71%																						
Tuple + return ternary + Remove _RunningLoop	6.060 +- 0.111	6.06	-17.25%																						
Combine all four optimizations	4.735 +- 0.111	4.735	-35.34%																						
Remove class _RunningLoop + Use Tuple instead of two attributes	6.241 +- 0.097	6.241	-14.78%		

Experimenting with different techniques to optimize get_event_loop and _get_running_loop.																	

After discuss with Yuri, decide not to expand _get_running_loop inside get_event_loop.
Combine tuple in _running_loop and Remove _RunningLoop (just use threading.local) can achieve the best improvement: 17.71% faster.
History
Date User Action Args
2017-09-05 17:19:35jimmylaisetrecipients: + jimmylai, yselivanov
2017-09-05 17:19:35jimmylaisetmessageid: <1504631975.49.0.0715054245706.issue31350@psf.upfronthosting.co.za>
2017-09-05 17:19:35jimmylailinkissue31350 messages
2017-09-05 17:19:35jimmylaicreate