Skip to content

perf(tar): update global PAX map in place after budget accounting - #14580

Merged
morluto merged 1 commit into
mainfrom
perf/tar-global-pax-in-place-14418
Nov 25, 2026
Merged

morluto merged 1 commit into
mainfrom
perf/tar-global-pax-in-place-14418

Conversation

@morluto

@morluto morluto commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Fixes #14418.

Root Cause

walkTar called global = withPax(global, pax.records) on every global PAX extended header (g), cloning all prior global PAX entries into a new Map on each update ($O(N^2)$ copy cost across repeated global headers).

Structural Fix

  • Extracted applyPaxInPlace(target, records) (shared by withPax) and mutated the walk-local global map in place strictly after retained.charge / retained.refund accounting.
  • Verified no consumer retains a reference to global across header iterations.

Validation

  • npm run test:local -- src/artifacts/tar/TarArtifactReader.test.ts (36/36 passed)
  • npm run check:fast (0 errors)

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-25T16:28:06.523598Z
We couldn’t complete this review. Comment @codex review to try again.
ef40788 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

This PR removes repeated copies of the global PAX map.

  • Tar reading updates global PAX records without copying the whole map.

Reviews (2) · Last reviewed commit: "perf(tar): update global PAX map in plac..." · Reviewed by Greptile

@morluto
morluto merged commit 43cdd26 into main Nov 25, 2026
41 checks passed
@morluto
morluto deleted the perf/tar-global-pax-in-place-14418 branch November 25, 2026 16:41
vincentkoc added a commit that referenced this pull request Nov 25, 2026
…-artifact-cancellation-projection

* commit '3d4633176f15f3bd8072751af788bf31c7f2e0d8':
  refactor(views): reuse JSON record and request-line projections (#14582)
  test(cutter): share loopback listener and descriptor fixtures (#14578)
  ci(apple): give the macOS lane room for the discovered macOS-gated tests
  test(native): accept plutil nesting diagnostics on stdout
  fix(native): admit the missing-UUID dyld_info refusal when it exits 0
  refactor(ghidra): share the executable file probe (#14573)
  refactor(artifacts): reuse carrier ranges and Mach-O field decoding (#14574)
  perf(tar): update global PAX map in place after budget accounting (#14580)
  refactor(manifest): share ordered sibling group traversal (#14571)
  test(browser): reuse page and Evidence inspection fixtures (#14581)
  ci(apple): run the macOS lane when a pull request changes a macOS-gated test
  test(cli): use the registered argument schemas directly (#14586)
  test(bun): share the file-handle read observer (#14577)
  test(mcp): share the successful tool assertion (#14576)
  test(uefi): reuse the driver file across firmware fixtures (#14570)
  feat(delivery)!: bound default results by an agent result budget (#14252)
vincentkoc added a commit that referenced this pull request Nov 25, 2026
* commit '3d4633176f15f3bd8072751af788bf31c7f2e0d8':
  refactor(views): reuse JSON record and request-line projections (#14582)
  test(cutter): share loopback listener and descriptor fixtures (#14578)
  ci(apple): give the macOS lane room for the discovered macOS-gated tests
  test(native): accept plutil nesting diagnostics on stdout
  fix(native): admit the missing-UUID dyld_info refusal when it exits 0
  refactor(ghidra): share the executable file probe (#14573)
  refactor(artifacts): reuse carrier ranges and Mach-O field decoding (#14574)
  perf(tar): update global PAX map in place after budget accounting (#14580)
  refactor(manifest): share ordered sibling group traversal (#14571)
  test(browser): reuse page and Evidence inspection fixtures (#14581)
  ci(apple): run the macOS lane when a pull request changes a macOS-gated test
  test(cli): use the registered argument schemas directly (#14586)
  test(bun): share the file-handle read observer (#14577)
  test(mcp): share the successful tool assertion (#14576)
  test(uefi): reuse the driver file across firmware fixtures (#14570)
  feat(delivery)!: bound default results by an agent result budget (#14252)
  ci(apple): discover and run every macOS-gated test on macOS
  test(apple): expect path-selected inspect_artifact in resource-only sessions
  fix(errors)!: keep only changed reader integrity checks retryable
@morluto morluto added the performance Performance regressions, scaling limits, and bounded-resource work label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tar global PAX accumulation repeatedly copies all prior attributes

1 participant