Razaekel / noise-rs

Procedural noise generation library for Rust.
Apache License 2.0
856 stars 120 forks source link

[rayon] Thread-safe cache #254

Closed dannymcgee closed 1 year ago

dannymcgee commented 3 years ago

This PR updates the cache module to be thread-safe. I added some timers to the complexmap example, and these are the results I got vs the develop branch (on a Ryzen 7 1700x 8-core/16-thread @ ~4GHz):

develop rayon
Unscaled 8m 58s Unscaled 1m 18s
4x 9m 25s 4x 1m 17s
16x 9m 29s 16x 1m 22s

Not the most scientific test I know, but the difference is pretty extreme. :)

Let me know if you'd like any changes to this. Also, I'd be happy to resolve conflicts with develop and open a PR into that branch as well if that's something you would be interested in, just let me know.