Commit b6d591f
Pool QueueWithRetry and cache filterDirtyFiles regexp
QueueWithRetry (79.5GB, 18.8% of allocs): pool via sync.Pool with
Release() that drains the 100K-element channel without closing it,
preserving the 1.6MB buffer across reuses. parallelExecutor.run uses
Release() instead of Close(); workers exit via context cancellation
when the exec loop goroutine defers execLoopCtxCancel(). Cleanup
ordering ensures stopWorkers() completes before Release().
filterDirtyFiles regexp (14.6GB, 3.3% of allocs): cache compiled
regexps in sync.Map keyed by pattern string. Each unique
(filenameBase, ext) pair compiles once instead of per-call.
Combined expected savings: ~94GB (22% of total allocations).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent fe17d1f commit b6d591f
File tree
3 files changed
+39
-4
lines changed- db/state
- execution
- exec
- stagedsync
3 files changed
+39
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
261 | 263 | | |
262 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| 702 | + | |
| 703 | + | |
702 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
703 | 712 | | |
704 | 713 | | |
705 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
706 | 732 | | |
707 | 733 | | |
708 | 734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
908 | | - | |
| 908 | + | |
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
916 | | - | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
917 | 919 | | |
918 | 920 | | |
919 | 921 | | |
| |||
0 commit comments