Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

Ericson2314
Copy link
Member

Fixes #3884

}
}
}
std::cout << topObj;
Copy link
Member

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).

Copy link
Member

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.

Copy link
Member Author

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.

@Ericson2314 Ericson2314 changed the title Get rid of json.hpp and use nlohmann/json everywhere WIP: Get rid of json.hpp and use nlohmann/json everywhere Aug 4, 2020
@stale
Copy link

stale bot commented Feb 12, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 12, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Apr 16, 2022
@Ericson2314 Ericson2314 reopened this Apr 16, 2022
@stale stale bot removed the stale label Apr 16, 2022
@Ericson2314
Copy link
Member Author

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.

@stale stale bot added the stale label Oct 29, 2022
@Ericson2314 Ericson2314 marked this pull request as draft February 2, 2023 14:56
@Ericson2314 Ericson2314 changed the title WIP: Get rid of json.hpp and use nlohmann/json everywhere Get rid of json.hpp and use nlohmann/json everywhere Feb 2, 2023
@stale stale bot removed the stale label Feb 2, 2023
@Ericson2314
Copy link
Member Author

It looks like this is no longer needed because #7313 did the the same same thing?

@Ericson2314
Copy link
Member Author

Ah yes, it is the same. Huzzah!

@Ericson2314 Ericson2314 deleted the one-json-way branch February 20, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get rid of json.hh and just use nlohmann/json
2 participants