Skip to content

Conversation

@Zaczero
Copy link
Member

@Zaczero Zaczero commented Dec 27, 2025

adl_serializer<DerivationOutput> previously built a std::set<std::string_view> of keys and compared against multiple temporary std::sets to select the output variant. Replaced this with a json.size() switch and direct key presence checks (optionalValueAt(...)) to avoid per-parse allocations and tree balancing.

The measured speedup is typically around 25%-80%, with Deferred case being 350% faster.

Motivation

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Copy link
Contributor

@Radvendii Radvendii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change a lot. Thanks for putting it together! I'm too tired tongiht, but when I get a chance I'll test to confirm the speedup on my machine.

auto [method, hashAlgo] = methodAlgo();
return DerivationOutput::Impure{
.method = std::move(method),
.hashAlgo = hashAlgo,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should presumably also be std::move(hashAlgo). I realise this is unrelated to the main change of this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an enum, so that's pointless.

@Zaczero Zaczero force-pushed the zaczero/calm-cattle branch from 1fd4481 to efa7f7c Compare January 3, 2026 18:42
@Zaczero Zaczero requested a review from Radvendii January 4, 2026 11:07
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.

3 participants