afonsolage / projekto

Voxel game made with Bevy Engine
MIT License
59 stars 4 forks source link

Improve terrain generation speed #71

Closed afonsolage closed 5 months ago

afonsolage commented 5 months ago

This issue is just to keep track of optimization that I'll do on current terrain generation speed. Currently testing with landscape radius of 4.

Benchmark 1: cargo run -p projekto_server --example server_bench --no-default-features
  Time (mean ± σ):      9.002 s ±  0.447 s    [User: 19.681 s, System: 0.354 s]
  Range (min … max):    8.491 s …  9.735 s    10 runs
heaptrack stats:
        allocations:            764155
        leaked allocations:     2319
        temporary allocations:  739426

image

afonsolage commented 5 months ago

After reusing Vec<voxel::Face> on meshing::generate_vertices it doesn't seem to have much improvement, even tho the temporary allocations was reduced.

Benchmark 1: cargo run -p projekto_server --example server_bench --no-default-features
  Time (mean ± σ):      9.609 s ±  0.551 s    [User: 20.467 s, System: 0.342 s]
  Range (min … max):    8.728 s … 10.256 s    10 runs

image