Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Release code slower than debug when using rayon
To learn Rust Iām doing a few small project, the last was an automatic lawn mover simulation, GitHub - johan162/gridcover
This had a very surprising result: The debug build is almost 8 times faster execution speed compared with release build if I enable parallelism through rayon
admittedly with simulation parameters that gives no benefit for a parallel approach (but all the overhead).
The result from the debug build using rayon
Simulation Results:
Simulation completed in : 00:24
...
and from the release build using rayon
Simulation Results:
Simulation completed in : 03:52
...
If I disable the use of par_iter
the release build completes in 2s and the debug build in 18s.
The parameters in this particular case gives no benefit of a parallell iterator so the overhead makes it unsuitable which I fully get. However, I don't get why (in principle) the release build would be soo much slower?
Are there some principle explanation for this behavior (or will it be down to nitty gritty rayon impl. details)?
Cheers,
P.S. Parameters used was:
$ gridcover -r 4 -w 500 -g 400 -s 0.5 -x 1 -y 1 -v 1 -c 99 -S 99 -C false
2 posts - 2 participants
š·ļø rust_feed