Skip to content

perf: upgrade pierre diffs#386

Merged
benvinegar merged 2 commits into
mainfrom
perf/pierre-diffs-1-2-2
May 30, 2026
Merged

perf: upgrade pierre diffs#386
benvinegar merged 2 commits into
mainfrom
perf/pierre-diffs-1-2-2

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Summary

  • upgrade @pierre/diffs from ^1.1.19 to ^1.2.2
  • extend reserved syntax-color remapping for the updated Pierre markdown token colors
  • keep the benchmark-driven parser speedup isolated from Hunk windowing changes

Benchmark notes

Local bun run bench -- --samples 3 showed parser-focused wins versus the pre-upgrade baseline:

  • bootstrap-load/git_parse_patch_ms: 15.30ms → 6.26ms
  • changeset-parse/balanced_changeset_parse_patch_ms: 6.77ms → 3.47ms
  • changeset-parse/large_single_file_parse_patch_ms: 2.68ms → 1.19ms

large-stream/cold_first_frame_ms was noisier/slower in the same run, so this PR keeps only the dependency upgrade for focused review.

Validation

  • bun test src/ui/diff/pierre.test.ts
  • bun run typecheck
  • bun run format:check
  • bun run lint
  • bun run bench -- --samples 3 --out /tmp/hunk-perf/final.json

This PR description was generated by Pi using OpenAI GPT-5

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 30, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​pierre/​diffs@​1.1.19 ⏵ 1.2.280 +110097 +199100

View full report

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 30, 2026

Greptile Summary

Upgrades @pierre/diffs from 1.1.19 to 1.2.2 (pulling in @pierre/theme@1.0.3) and extends the reserved token-color remap table to cover two new keyword hues the updated theme introduces, preventing them from visually colliding with diff add/remove semantic colors.

  • package.json / bun.lock: version pins updated with correct checksums; the only transitive churn is @pierre/theme jumping from 0.0.28 to 1.0.3.
  • pierre.ts: RESERVED_PIERRE_TOKEN_COLORS gains #ff855e (dark) and #d5512f (light), both mapped to "keyword", mirroring the pattern already established for the existing red keyword shades.

Confidence Score: 5/5

Safe to merge — the change is a focused dependency bump with a small, correct additive update to the color-remap table.

All three files are well-contained: the lockfile reflects clean dependency resolution, the version range in package.json is consistent, and the two new color entries in pierre.ts follow exactly the same established pattern as the existing ones. The normalizeHighlightedColor lookup handles unknown keys gracefully (returns the raw color), so even if a color were missing from the table it would degrade silently rather than crash. No logic was restructured and no existing behavior was altered.

No files require special attention.

Important Files Changed

Filename Overview
src/ui/diff/pierre.ts Adds two new hex color entries (#ff855e dark, #d5512f light) to RESERVED_PIERRE_TOKEN_COLORS to remap new keyword colors introduced in @pierre/theme@1.0.3; logic and caching are unchanged and correct.
package.json Bumps @pierre/diffs from ^1.1.19 to ^1.2.2; transitive @pierre/theme moves from 0.0.28 to 1.0.3 (major version).
bun.lock Lockfile updated to pin @pierre/diffs@1.2.2 and @pierre/theme@1.0.3 with correct checksums; no other dependency churn.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Pierre HAST token\n(inline style: color:#...)"] --> B["parseStyleValue()\ncache parsed CSS"]
    B --> C["normalizeHighlightedColor(color, theme)"]
    C --> D{"color in\nRESERVED_PIERRE_TOKEN_COLORS\n[appearance]?"}
    D -- "Yes\n(e.g. #ff6762, #ff855e dark\n#d52c36, #d5512f light)" --> E["→ theme.syntaxColors['keyword']\nor theme.syntaxColors['string']"]
    D -- "No\n(all other hues)" --> F["→ pass through unchanged"]
    E --> G["RenderSpan.fg"]
    F --> G
    G --> H["flattenedHighlightedLineCache\n(WeakMap per node)"]
Loading

Reviews (1): Last reviewed commit: "perf: upgrade pierre diffs" | Re-trigger Greptile

@benvinegar benvinegar merged commit a689d3a into main May 30, 2026
7 checks passed
@benvinegar benvinegar deleted the perf/pierre-diffs-1-2-2 branch May 30, 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.

1 participant