ujson is not appreciably faster than json #77

Open
opened 2025-10-14 17:06:02 -06:00 by navan · 0 comments
Owner

Originally created by @adalke on 6/4/2018

In Python 2.7 the built-in json module was significantly slower than the third-party ujson and cjson modules at parsing the fragment file. If one of the latter two is not found, mmpdb prints a warning message to suggest installing one of those two modules, then falls back to using the json module.

It appears that Python 3.6's json module, while still slower than cjson, is no longer sufficiently slower as to warrant having that warning message. In one test, json took 2m09s while cjson took 2m04s.

Need to re-run the timing tests with Python 3.5, 3.6, and 3.7. If it's no longer needed then have the warning message only for Python 2.7.

*Originally created by @adalke on 6/4/2018* In Python 2.7 the built-in json module was significantly slower than the third-party ujson and cjson modules at parsing the fragment file. If one of the latter two is not found, mmpdb prints a warning message to suggest installing one of those two modules, then falls back to using the json module. It appears that Python 3.6's json module, while still slower than cjson, is no longer sufficiently slower as to warrant having that warning message. In one test, json took 2m09s while cjson took 2m04s. Need to re-run the timing tests with Python 3.5, 3.6, and 3.7. If it's no longer needed then have the warning message only for Python 2.7.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/mmpdb#77
No description provided.