On Sat, Jun 13, 2020 at 8:14 PM J. Pic <j...@yourlabs.org> wrote: > > I'm not sure I should rewrite my asyncio code to threading, I'll just keep > going asyncio, maybe one day it'll be possible to get the best of both worlds > ... > > On #python they generally tell me that the extra syntax is worth it because > of the internal details, that rewriting to threads does not seem like a good > idea on the long run. > > People tell me "you can use threads if you want, but why not keep your > codebase in asyncio", so really I'm not sure what I /should/ do. > > Basically, my use case is about subprocess call programing, so I got await on > 10% of my SLOCs, it's on a toy project on https://yourlabs.io/oss/shlax >
Your project is fundamentally about instantiating processes? Then any overhead you'd see from threading rather than asyncio is going to be completely lost in the noise. The actual fundamental work of what you're doing is WAY more than a few extra context switches. Code whichever way makes you happier, and don't take any notice of microbenchmarks. ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/XANRX4VRGCXJJXRFZVWJDIZHNXDBBLA2/ Code of Conduct: http://python.org/psf/codeofconduct/