Skip to content

perf: multi-worker parallelism + early-exit (merges #11 with #8 and #10)#12

Merged
cpaczek merged 1 commit into
mainfrom
merge-pr11
Apr 2, 2026
Merged

perf: multi-worker parallelism + early-exit (merges #11 with #8 and #10)#12
cpaczek merged 1 commit into
mainfrom
merge-pr11

Conversation

@cpaczek

@cpaczek cpaczek commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Summary

Merges PR #11 (multi-worker parallelism + early-exit optimization) on top of PR #8 (Windows/Node FNV-1a fix), adopting the 8-core cap from PR #10.

  • Multi-worker parallelism: Spawns up to 8 workers (one per core, capped at 8) for ~Nx wall-clock speedup
  • Early-exit in hot loop: Inlined quickRoll() with per-attribute checks — mismatches skip remaining RNG calls immediately
  • FNV-1a support preserved: Workers use hashKey() abstraction that dispatches to FNV-1a or Bun.hash based on --fnv1a flag
  • Progress display: Shows [N cores] during search and total attempts across all workers
  • Reduced IPC overhead: Progress reporting interval bumped from 25K to 100K iterations

Credits:

Closes #11

Test plan

  • node --check passes on all modified files
  • CLI launches and runs correctly (smoke tested interactive flow)
  • Verify multi-core progress display ([N cores])
  • Verify search completes and correctly patches the binary
  • Test on Node 18.x to confirm no import errors

🤖 Generated with Claude Code

Spawn one worker per CPU core for ~Nx speedup on the salt search.
Inline attribute checks with early-exit so mismatches skip remaining
RNG calls (e.g. 99% of iterations skip after rarity check for legendary).
Bump progress interval from 25K to 100K to reduce IPC overhead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cpaczek cpaczek merged commit e52ba37 into main Apr 2, 2026
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