I really would like an option of not generating a new PyObject every time loads() is called and rather update existing one.
It would reduce amount of memory the interpreter allocate. This use case would be very handy during stream processing, when a message get processed and you for sure don't need it anymore. Of course garbage collector will take care of it implicitly, but having control of it is a great option, specially when you are dealing with streams with high frequencies, like > 1KHz, As result instead of having ramp-up memory it would be just a linear.
I really would like an option of not generating a new PyObject every time
loads()
is called and rather update existing one.It would reduce amount of memory the interpreter allocate. This use case would be very handy during stream processing, when a message get processed and you for sure don't need it anymore. Of course garbage collector will take care of it implicitly, but having control of it is a great option, specially when you are dealing with streams with high frequencies, like > 1KHz, As result instead of having ramp-up memory it would be just a linear.
As proposed API, it might look like: