OK, i have it, apologies.. i was benching the complex path with an extra dereference and with such a tight loop it makes so much more difference than i thought was possible.
now all makes sense. thanks. On Sunday 10 November 2024 at 19:25:39 UTC Axel Wagner wrote: > On Mon, 11 Nov 2024 at 03:24, 'simon place' via golang-nuts < > golan...@googlegroups.com> wrote: > >> yes, see the bench and code in the OP. >> > > I don't see any benchmarking code in this thread. > From the godbolt output <https://go.godbolt.org/z/jbvbrPb6j>, it looks to > me as if the compiler generates a single move, which seems as efficient as > it can be. > > >> >> but since your way is slightly different (just possibly making a >> difference to the compiler? unpredictable eliding seems a poor thing to >> rely on.) i benched that, exactly the same, that is, about 5x slower than >> just operating on a single float. i'd look at the m/c, except at 500% >> slower i'm happy it can't be, maybe one day? >> >> i'm going to search for a lib. (if/when speed becomes a problem.) >> >> also unfortunate, complex not being a lib, that wouldn't just be a drop >> in. >> >> >> >> -- >> > You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> > To view this discussion visit >> https://groups.google.com/d/msgid/golang-nuts/2b65ea5f-3fbd-440d-a6e0-400d61d6a3efn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/2b65ea5f-3fbd-440d-a6e0-400d61d6a3efn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/f6aea2d3-6fed-40b5-8ce4-92637b4145e0n%40googlegroups.com.