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

Use <nlohmann/json_fwd.hpp>. #1472

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Use <nlohmann/json_fwd.hpp>. #1472

merged 1 commit into from
Sep 30, 2024

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Sep 27, 2024

We identified recompiling JSON templates to contribute noticably to the compile time:

**** Templates that took longest to instantiate:
16889 ms: nlohmann::basic_json<>::parse<const char *> (42 times, avg 402 ms)
12363 ms: nlohmann::basic_json<>::basic_json (127 times, avg 97 ms)
10129 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (42 times, avg 241 ms)
 7934 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (42 times, avg 188 ms)
 6145 ms: nlohmann::basic_json<>::json_value::json_value (211 times, avg 29 ms)

Fortunately, we can avoid the issue by using a forward declaration.

We identified recompiling JSON templates to contribute noticably
to the compile time:

    **** Templates that took longest to instantiate:
    16889 ms: nlohmann::basic_json<>::parse<const char *> (42 times, avg 402 ms)
    12363 ms: nlohmann::basic_json<>::basic_json (127 times, avg 97 ms)
    10129 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (42 times, avg 241 ms)
     7934 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (42 times, avg 188 ms)
     6145 ms: nlohmann::basic_json<>::json_value::json_value (211 times, avg 29 ms)

Fortunately, we can avoid the issue by using a forward declaration.
bbpadministrator pushed a commit to BlueBrain/nmodl-references that referenced this pull request Sep 27, 2024
@1uc 1uc marked this pull request as ready for review September 30, 2024 08:00
@1uc 1uc merged commit 6df0d13 into master Sep 30, 2024
12 checks passed
@1uc 1uc deleted the 1uc/json_fwd branch September 30, 2024 08:38
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.

2 participants