Skip to content

perf: precompute find/replace as []byte once per run#99

Open
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:perf/precompute-find-replace-bytes-issue-22-v2
Open

perf: precompute find/replace as []byte once per run#99
leno23 wants to merge 1 commit into
dolph:mainfrom
leno23:perf/precompute-find-replace-bytes-issue-22-v2

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 31, 2026

Summary

  • Store findB and replaceB on the walk context via newFindReplace
  • Use precomputed slices in ReplaceContents instead of per-file conversion

Test plan

  • go test ./...

Fixes #22

Made with Cursor

Convert FIND and REPLACE to []byte when building the walk context so
each file rewrite does not re-allocate the same byte slices.

Fixes dolph#22
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.

find/replace strings re-allocated as []byte for every file

1 participant