Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pickler().fast
#1
I'm working on a codebase that experienced, in the far past, a blowup in memory when trying to pickle certain class instances. It was determined, at that time, that the broad shallow classes resulted in large caches as the pickler was traversing the object graph. I have been hard pressed to find other examples of this problem online, but the closest example I found on SO mentioned the .fast attribute of pickle.Pickler(). This may do EXACTLY what I want it to do, and to that end I have a few questions

1) Is this a well known problem or limitation to pickling?
2) Is the .fast attribute actually deprecated? I found the pickle source code, and it seems to be used very explicitly, exactly where I would expect in the memo method.
3) Is there any downside (besides the obvious of pickling the object multiple times) of setting this attribute to 1.

Thank you!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020