Skip to content

Write optimization - #122

Merged
DecJA merged 2 commits into
mainfrom
memory-optimization
Oct 30, 2026
Merged

DecJA merged 2 commits into
mainfrom
memory-optimization

Conversation

@DecJA

@DecJA DecJA commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Significant reduction in simulation time by optimizing events writing

  • imprint_wins shorts JSON text instead of nested objects
  • Deepcopy is replcaced with custom clone function in several places
  • get_clusters uses optimized recursive search path
  • json_ready_sym makes one getattr call instead of hasattr and getattr
  • create_board looks up per-reel values once per reel
  • cache reelstrips and distribution conditions
  • temp force files use pickle instead of ast.literal_eval
  • multi thread final book compression

Results

Run Before After Speedup
Single thread, 6 sample games — — 1.97–2.26× faster, about 2.5× lower peak memory
cluster, 8 threads, 48k sims/mode 184.2 s 53.3 s 3.46×
lines, 8 threads, 96k sims/mode 93.8 s 28.3 s 3.31×
scatter, 8 threads, 48k sims/mode 143.5 s 60.3 s 2.38×
merge_luts, 200k base rows 21 s 0.02 s —

@DecJA
DecJA merged commit 6e0c69e into main Oct 30, 2026
1 check passed
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