UnfortunateShort@lemmy.worldtoNo Stupid Questions@lemmy.world•(In Python) Can you save an object that is in memory to disk and reload it at a later time?
13·
3 days agoI think pickle is what you want.
Keep in mind that this might have a huge performance impact if you do it all the time - it’s still IO even when it’s not parsing.
You can stuff all the info into an object and use it this way, no problem. I just wanted to point out that this doesn’t have zero performance impact compared to what you currently have.
So (depending on how your OS caches files) you might not want to do this like twice in a lambda that you pass to an iterator over a huge slice or something.