Skip to content

perf: [DSM-144] Misc certification optimizations#10510

Open
alin-at-dfinity wants to merge 4 commits into
masterfrom
alin/DSM-144-misc-certification-optimizations
Open

perf: [DSM-144] Misc certification optimizations#10510
alin-at-dfinity wants to merge 4 commits into
masterfrom
alin/DSM-144-misc-certification-optimizations

Conversation

@alin-at-dfinity

Copy link
Copy Markdown
Contributor
  • Use precomputed empty leaf hash instead of computing it from scratch every time.
  • Pass the key to MapTransformFork::mk_tree by reference, don't clone it (especially since it's only used in a couple of cases).
  • Simplify CanisterFork.

* Use precomputed empty leaf hash instead of computing it from scratch every time.
* Pass the key to `MapTransformFork::mk_tree` by reference, don't clone it (especially since it's only used in a couple of cases).
* Simplidy CanisterFork.
@alin-at-dfinity alin-at-dfinity requested a review from a team as a code owner June 18, 2026 16:19
@github-actions github-actions Bot added the perf label Jun 18, 2026
@alin-at-dfinity

Copy link
Copy Markdown
Contributor Author

This speeds up sequential HashTree computation by about 10%. Unfortunately, the effect on concurrent hashing is a lot smaller (1%-2%), because the bottleneck is memory accesses, not computation.

@zeropath-ai

zeropath-ai Bot commented Jun 18, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to a6f274f.

Security Overview
Detected Code Changes

| Change Type | Relevant files

... (code changes summary truncated to fit VCS comment limits.)

}

const CERTIFIED_DATA_LABEL: &[u8] = b"certified_data";
const CONTROLLER_LABEL: &[u8] = b"controller";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this gone in all certification versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, only the labels in CANISTER_LABELS and CANISTER_NO_MODULE_LABELS are (and were, before this change) populated.

This was left behind from some old certification version, likely because the match statements below still referenced it, so the compiler did not report it as unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants