Skip to content

Optimize world generation using parallel processing#9

Merged
Vianpyro merged 6 commits intomainfrom
optimize/use_parallel_processing
Mar 7, 2026
Merged

Optimize world generation using parallel processing#9
Vianpyro merged 6 commits intomainfrom
optimize/use_parallel_processing

Conversation

@Vianpyro
Copy link
Member

@Vianpyro Vianpyro commented Mar 6, 2026

No description provided.

@Vianpyro Vianpyro requested a review from Copilot March 6, 2026 13:28
@Vianpyro Vianpyro self-assigned this Mar 6, 2026
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 parallelizes several world-generation hot loops using Rayon to reduce end-to-end generation time for large maps (default 10,000×10,000).

Changes:

  • Parallelize elevation grid generation by computing rows concurrently.
  • Parallelize terrain classification and biome classification by processing rows concurrently.
  • Parallelize per-city resource aggregation across city slots.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/terrain.rs Uses par_iter_mut() to classify terrain rows in parallel.
src/elevation.rs Uses par_iter_mut() to compute elevation rows in parallel.
src/biome/generation.rs Uses par_iter_mut() to compute biome rows in parallel.
src/biome/city_resources.rs Uses par_iter() to compute per-city resource summaries in parallel.

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

You can also share your feedback on Copilot code review. Take the survey.

Vianpyro and others added 3 commits March 6, 2026 08:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Vianpyro Vianpyro merged commit 2810a95 into main Mar 7, 2026
0 of 2 checks passed
@Vianpyro Vianpyro deleted the optimize/use_parallel_processing branch March 7, 2026 12:50
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