Re:Spectro: Adventures in Go
by millstone on Saturday November 21, 2015 @08:41PM
(#10608732)
I wasn't referring to the performance cost of randomizing itself, but to the fact that randomization can affect the performance of whatever it is you're measuring.
For example, say you want to benchmark a function that extracts the keys from a map into a slice, and then sorts it via quicksort. Quicksort's performance is affected by the initial ordering, so different runs of the function will behave differently. Was this run really faster, or did I just get lucky with the order this time?
Re:Spectro: Adventures in Go
by AYBABTME on Saturday November 21, 2015 @10:11PM
(#10608927)
True then, it's not deterministic. I guess that's quite an annoyance actually, you can't use maps in a single threaded program if you want deterministic outcomes? I wonder if the seed of fastrand1 is constant.
For example, say you want to benchmark a function that extracts the keys from a map into a slice, and then sorts it via quicksort. Quicksort's performance is affected by the initial ordering, so different runs of the function will behave differently. Was this run really faster, or did I just get lucky with the order this time?