I was told that ijson create a pipe between the file on the hardrive and the memory to save the memory, so it's more memory efficient than json library. However, I was also told that ijson can be faster than json with the incremental parsing, which did not make sense to me at all. The hard drive's IO was usually much slower than the Ram's IO to out compete the cpu clock speed.
I have a 2 million entry json file around 3.5 GB to be loaded, and the data required very frequent search through the files. Can msgspec or ijson be faster than json? Or should I just load the json file into the RAM?