-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leaks in ujson #4
Comments
Oh wow, thanks! This could explain a lot actually. Do you have time to port their patch over? I have to say, I feel pretty sheepish about this. The fact that ujson had that PR open for a while was one of the things that made us think that vendoring our own fork might not be such a bad idea. But...then I got started doing srsly, and I forgot all about that PR :(. So I never ended up actually integrating the patch! |
Same benchmark with patch applied:
|
Should be live now 🎉 . Thanks again. |
We've replaced the usage of json with srsly.ujson a while ago for that free performance boost since we are doing lots of JSON encoding/decoding and we already have it installed as part of spacy, but now we had to move back because of some terrible memory leaks:
Output with ujson:
Output with stdlib json:
Benchmark ran on python3.7 on macos, but same leak exists on Debian with python27.
You can increase the range from 10 and you will eventually run of our memory.
Days were spent on this issue, because I would never suspect the JSON library to be at fault, but it is. I don't know if it affects Spacy in any way.
Could be related: ultrajson/ultrajson#270
The text was updated successfully, but these errors were encountered: