zlacker

[return to "From slow to SIMD: A Go optimization story"]
1. devjam+322[view] [source] 2024-01-24 07:58:34
>>rbanff+(OP)
The author used:

    sum := float32(0)
Over Go's zero-value default initialization e.g.

    var sum float32
A nit stylistically but wondering if there was a good reason to do so?
◧◩
2. mehele+J22[view] [source] 2024-01-24 08:04:11
>>devjam+322
One advantage is that it makes the value explicit so anyone reading the code irregardless of their familiarity with Go will know it will be zero.
[go to top]