Speed up cellular noise #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces both a small performance increase to the cellular sampler as well as tools for verifying this.
It does not seem to do a lot in terra, but it's more than nothing. I've ran the terra benchmark three times without warmup.
Have a good evening!
Baseline
Benchmark Mode Cnt Score Error Units
CellularSamplerBenchmark.cellular:benchmarkCellular2D thrpt 2 22711531.811 ops/s
CellularSamplerBenchmark.cellular:benchmarkCellular3D thrpt 2 7568400.360 ops/s
benchmarkAtan2Java thrpt 2 104959231.059 ops/s
Preloaded 625 chunks in world in 6638.519721ms. That's 94.1474946625379 Chunks/s
Preloaded 625 chunks in world in 6102.310949ms. That's 102.4202150993994 Chunks/s
Preloaded 625 chunks in world in 6780.724422ms. That's 92.17304245136303 Chunks/s
After this PR
Benchmark Mode Cnt Score Error Units
CellularSamplerBenchmark.cellular:benchmarkCellular2D thrpt 2 31278943.117 ops/s
CellularSamplerBenchmark.cellular:benchmarkCellular3D thrpt 2 9918926.507 ops/s
benchmarkAtan2Fast thrpt 2 2495479389.351 ops/s
Preloaded 625 chunks in world in 5855.675151ms. That's 106.73406291898996 Chunks/s
Preloaded 625 chunks in world in 6097.494681ms. That's 102.50111442450638 Chunks/s
Preloaded 625 chunks in world in 5632.24376ms. That's 110.96820852086132 Chunks/s