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
Get rid of json.hpp and use nlohmann/json everywhere #3893
Conversation
1b114f0
to
e32a29b
Compare
} | ||
} | ||
} | ||
std::cout << topObj; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is a big difference between json.hpp and nlohmann/json: the former outputs JSON on the fly while the latter builds the entire JSON datastructure in memory. So the former is O(1) memory (more or less) while the latter is O(n).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also means that if you're piping the output into another tool, that tool won't receive any data until everything has been processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that was bugging me to. Some thing we do aren't too big so it doesn't really matter, but others like nar listings it might. nlohmann/json#2275 They are talking about streaming interfaces here, maybe I'll go pitch in.
0844bd2
to
c25be25
Compare
I marked this as stale due to inactivity. → More info |
I closed this issue due to inactivity. → More info |
This is not good yet, but nlohman json has been improving the sort of "direct printing" one would need to fix the perf issues here. I would rather keep this open as a reminder me to check back in on nlohman json and once that is done redo this. |
It looks like this is no longer needed because #7313 did the the same same thing? |
Ah yes, it is the same. Huzzah! |
Fixes #3884