3 ms·
1. Pickling is, as already mentioned by a cocommenter, slow. Do not use it. 2. Do not use loops, use itertools. (Python 3.12 got a nice 'batched' function, btw
by mharig 2y ago
1. Pickling is, as already mentioned by a cocommenter, slow. Do not use it.
2. Do not use loops, use itertools. (Python 3.12 got a nice 'batched' function, btw.)
3. Preallocate memory, where possible.
4. multiprocessing.shared_memory may help.
5. Something like cython may help.
6. Combination of multiprocessing with asyncio (or multithreading) may help.
7. memmap file access might help.
You see, you have a lot of options before you need to learn another language.