fractal icon indicating copy to clipboard operation
fractal copied to clipboard

Remove tokio dependency

Open Spaceface16518 opened this issue 5 years ago • 2 comments

Substituted with a manually chunked std::thread approach. While this does use a different dependency, it's significantly less dependencies overall.

Currently, this decreases performance by a couple milliseconds on my machine, but hopefully I will fix this in the next few commits. I'm going to create some benchmarks to calculate the best buffer size for the channel as well.

Spaceface16518 avatar Nov 23 '20 21:11 Spaceface16518

Hi Spaceface16518. Thank you for your merge request. I'm 100% open to remove the tokio dependency but I'll not do it while it decreases the performance. By the way, I received a comment on the reddit thread that mention a 60% performance boost with a simple modification. That could be an interesting approach to evaluate: https://www.reddit.com/r/rust/comments/jyziio/a_fractal_i_rendered_with_rust_without_any/gd8xvl2?utm_source=share&utm_medium=web2x&context=3

abour avatar Nov 24 '20 18:11 abour

I'm 100% open to remove the tokio dependency but I'll not do it while it decreases the performance.

I agree, I'm working on performance right now.

By the way, I received a comment on the reddit thread that mention a 60% performance boost with a simple modification. That could be an interesting approach to evaluate: https://www.reddit.com/r/rust/comments/jyziio/a_fractal_i_rendered_with_rust_without_any/gd8xvl2?utm_source=share&utm_medium=web2x&context=3

This change uses the rayon library. While it would be a lighter dependency than tokio (tokio itself depends on rayon) but I still feel like avoiding dependencies that do everything for you is a goal here (even if the Go standard library does everything for you).

Spaceface16518 avatar Nov 24 '20 20:11 Spaceface16518