iJson.items() 在迭代之前是否将整个 JSON 文件加载到内存中?

Does iJson.items() load the entire JSON file into memory before iterating?

我最近开始使用 iJson 迭代地传递我的 JSON 数据。我将处理巨大的 JSON 文件(100+ GB)。

iJson 的文档非常有限,没有提及太多,所以他们对回答我的问题帮助不大。

调用时 iJson.items() 是否将整个 JSON 文件加载到内存中?

list = ijson.items(in_file)
# Does this load the entire contents of in_file to memory?

不,不是。立即加载所有内容会破坏 ijson 的全部要点,即不要这样做。你可以看看source for the various backends (the pure-Python backend是默认的)如果你想确认的话。