Because of GIL Python always runs on one core, so event loop too. We can create CPU_COUNT processes and upload files in parallel, but there is two big problems: the first, most obvious, is possible FloodWaitError on Telegram side, the second is pickle, it just doesn't work with coroutines and big classes.
aiomultiprocess.Pool doesn't work, as it rely on pickle. dill instead of pickle.... doesn't work. We need to fully rewrite fastelethon, so it's coros will return parts from which we can reconstruct objects in other Process.
It looks good in theory, but FloodWaitError and GIL... meh, i don't want to do it now. If anyone has ideas - feel free to publish them here.
Because of GIL Python always runs on one core, so event loop too. We can create
CPU_COUNT
processes and upload files in parallel, but there is two big problems: the first, most obvious, is possibleFloodWaitError
on Telegram side, the second ispickle
, it just doesn't work with coroutines and big classes.aiomultiprocess.Pool
doesn't work, as it rely onpickle
.dill
instead ofpickle
.... doesn't work. We need to fully rewrite fastelethon, so it's coros will return parts from which we can reconstruct objects in other Process.It looks good in theory, but
FloodWaitError
and GIL... meh, i don't want to do it now. If anyone has ideas - feel free to publish them here.