Skip to content

perf: use 64-bit words in bitpacked Life example - #1385

Merged
fglock merged 1 commit into
masterfrom
performance/life-bitpacked-64bit
Sep 15, 2026
Merged

fglock merged 1 commit into
masterfrom
performance/life-bitpacked-64bit

Conversation

@fglock

@fglock fglock commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a 64-bit flattened bit-packed Life implementation
  • make flat64 the default algorithm
  • retain 32-bit flat and 2D parallel modes for comparison

On a 320x200 random grid for 1,000 generations (JVM backend), warmed runs were:

  • flat: 7.63 Mcells/s
  • flat64: 13.15-13.16 Mcells/s (+72%)

Validation

  • perl -c examples/life_bitpacked.pl
  • scalar-oracle glider check after 100 generations: 10 live cells in system Perl, POJ JVM, and POJ interpreter modes
  • JVM benchmark above

make was intentionally stopped at the user's request because this change is Perl-only.

Add a flat 64-bit implementation and make it the example default. This halves
the packed-word loop count while retaining the 32-bit modes for comparison.

Generated with Codex (OpenAI)
https://openai.com/codex/

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock merged commit db1aa78 into master Sep 15, 2026
2 checks 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