maddyblue / go-dsp

Digital Signal Processing for Go
http://godoc.org/github.com/mjibson/go-dsp
ISC License
858 stars 89 forks source link

Simplify little-endian byte conversions #9

Closed nlefler closed 10 years ago

nlefler commented 10 years ago

Use stdlib functions for converting little-endian bytes to single values

maddyblue commented 10 years ago

I'm not convinced this is better. It looks slower, higher memory, and readability is about the same.

sbinet commented 10 years ago

just my 2c, but, it looks like one is doing 4 bound-checks and creating a completely new slice, while the other is doing 2 bound-checks and only sub-slicing (so no allocation of a new backing array)

nlefler commented 10 years ago

I think it reads easier, and the stdlib is well tested. I doubt there are any noticeable performance or memory differences.

maddyblue commented 10 years ago

If you can document some performance improvements I will reconsider this. But it sounds like we disagree about the readability, so I'm not planning on committing this.

nlefler commented 10 years ago

I doubt there will be perf improvements. Closing.