According to the official documentation (https://pypi.org/project/jsonslicer/), the basic configuration of Json Slicer yields 586.5K objects/sec, ijson with Python at the back-end yields 32.2K objects/sec, while ijson with C back-end (ijson.yajl2_cffi) yields 75.7Kobjects/sec.
When I used the two libraries on a deeply nested JSON file of 5GB size, it was expected that Json Slicer, being a wrapper on YAJL (https://lloyd.github.io/yajl/) would execute faster than ijson with pure Python implementation. However, the time taken by Json Slicer was 607.8014905452728 sec, while ijson took 308.19292974472046 sec.
According to various sources (https://lpetr.org/2016/05/30/faster-json-parsing-python-ijson/ , http://explique.me/Ijson/), ijson with C backend should work faster than that with pure Python back-end. However, the time taken by ijson with C backend was 2016.68796280378929 sec.
This behaviour was observed during multiple runs on different occasions on different set of Json files of various sizes.
My system configuration is Intel i7 with 20GB RAM. Multiprocessing was not used during the execution of the script.
Please can somebody explain the root cause of such strange behaviour? Also please let me know a solution to this.