Re:Go 1.11 Beta 1 is released
by zimpenfish on Wednesday June 27, 2018 @01:38AM
(#17406007)
You're printing `b` three times in that Playground which makes it a look skewed.
a: 25100
b: 25080
c: 25080
d: 25080
vs a: 24973
b: 25010
c: 25013
d: 25004
Re:Go 1.11 Beta 1 is released
by cup-of-tea on Wednesday June 27, 2018 @02:57AM
(#17406253)
So it's deterministic. I got the same numbers.
On the Playground or on your PC? The Playground has an execution cache, so the same input code always gives the same (thus "deterministic") result.
Re:Go 1.11 Beta 1 is released
by cup-of-tea on Wednesday June 27, 2018 @05:11AM
(#17406766)
Ah OK, it was on the playground. Is it deterministic when not cached?
It is not deterministic on playground if it is not cached.
You can add dummy code to the file to break free from the cache.
https://play.golang.org/p/cnAXBEZJm2B
(fixed playground link)