Skip to content

[PROTON] Reduce msgpack serialization overhead-1#10393

Merged
Jokeren merged 39 commits into
mainfrom
keren/proton-fast-file-write-base
May 29, 2026
Merged

[PROTON] Reduce msgpack serialization overhead-1#10393
Jokeren merged 39 commits into
mainfrom
keren/proton-fast-file-write-base

Conversation

@Jokeren
Copy link
Copy Markdown
Contributor

@Jokeren Jokeren commented May 27, 2026

Use string_view and packFixStrLiteral

@Jokeren Jokeren requested review from CRobeck and fywkevin as code owners May 27, 2026 15:46
@Jokeren Jokeren force-pushed the keren/proton-fast-file-write-base branch from 8ae066c to f498c30 Compare May 27, 2026 15:48
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ae066c2df

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +449 to +450
MetricSummary metricSummary;
const std::map<MetricKind, std::unique_ptr<Metric>> emptyMetrics;
metricSummary.hasKernelMetric = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore the metric-summary prepass before packing

When a profile contains PC sampling or cycle metrics only on descendants/linked nodes, the root metrics map is counted and written before those children call packMetrics, so hasPCSamplingMetric/hasCycleMetric are still false and the required zero-valued root fields are omitted; conversely this line now emits kernel root fields even for profiles with no kernel metrics. The previous pre-order scan populated metricSummary from direct and linked metrics before serializing the root, which is needed for MsgPack to match the JSON Hatchet schema.

Useful? React with 👍 / 👎.

Comment on lines +664 to +666
writer.packMap(
countMetricEntries(treeNode.metricSet.metrics, isRoot) +
static_cast<uint32_t>(treeNode.metricSet.flexibleMetrics.size()));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include promoted linked flexible metrics in concrete frames

For graph metric nodes that are direct children of the virtual root, upsertLinkedFlexibleMetric(..., linkedId) stores their values under that child id, and the JSON serializer promotes those values into the concrete node's metrics before appending the virtual child. This new map count only includes the concrete node's own flexible metrics, while packLinkedVirtualNode only promotes metrics from virtualNode.children, so linked flexible metrics attached to the virtual root children are dropped from MsgPack output for captured graph metrics.

Useful? React with 👍 / 👎.

@Jokeren Jokeren force-pushed the keren/proton-fast-file-write-base branch from f498c30 to db814ea Compare May 27, 2026 18:20
@Jokeren Jokeren merged commit c2451b6 into main May 29, 2026
10 checks passed
@Jokeren Jokeren deleted the keren/proton-fast-file-write-base branch May 29, 2026 02:02
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