Skip to content

Conversation

@louis-e
Copy link
Owner

@louis-e louis-e commented Jan 6, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 6, 2026 16:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the ground generation algorithm to process blocks in a chunk-by-chunk manner rather than iterating through the entire world in X-Z order. This optimization improves CPU cache locality by keeping the same region/chunk HashMap entries hot in the cache, reducing cache misses during iteration.

Key Changes:

  • Restructured ground generation loops to iterate by chunks (16×16 blocks) first, then iterate within each chunk
  • Added chunk coordinate calculations using bit shift operations for efficiency
  • Included boundary clamping to handle partial chunks at the edges of the bounding box

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

⏱️ Benchmark run finished in 0m 28s
🧠 Peak memory usage: 860 MB

📈 Compared against baseline: 30s
🧮 Delta: -2s
🔢 Commit: 3200cdc

🟢 Generation time is unchanged.

📅 Last benchmark: 2026-01-06 16:15:04 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

@louis-e louis-e merged commit 7bbee28 into main Jan 6, 2026
9 checks passed
@louis-e louis-e deleted the ground-gen-cache-locality branch January 6, 2026 16:15
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