3 ms·
Profiling results: - initial time: 49s - replacing default thread-safe RNG with rand.New sliced 6 seconds off. (the default RNG uses mutexes), = 43s - use fl
by cabirum 8y ago
Profiling results:
- initial time: 49s
- replacing default thread-safe RNG with rand.New sliced 6 seconds off. (the default RNG uses mutexes), = 43s
- use float64 instead of float32 and remove many type conversions. Another two seconds off. = 41s.
As others suggested, go still lacks many compile time optimizations and the implementation could be improved.
- weberc2 8y agoI did some profiling too--I shaved off 10-15s by using the C xorshift implementation instead of rand.Float32() (which spends a lot of time locking a mutex).