Open slimsag opened 10 years ago
By removing binary.Read
calls in tight loops (mostly due to it's small buffer allocation internally) we have gained roughly a 60% performance improvement with Int24
decoding now on-par with the other decoders (finally).
benchmark old ns/op new ns/op delta
BenchmarkDecodeFloat32 14861757 5489679 -63.06%
BenchmarkDecodeFloat64 16008682 7067748 -55.85%
BenchmarkDecodeUint8 13951858 4908209 -64.82%
BenchmarkDecodeInt16 14685837 5394720 -63.27%
BenchmarkDecodeInt24 50474652 5591962 -88.92%
BenchmarkDecodeInt32 15584887 5472800 -64.88%
BenchmarkDecodeALaw 14637388 4956828 -66.14%
BenchmarkDecodeMuLaw 14626045 4966246 -66.05%
Moving the previous discussion from azul3d/audio#5 to here.
v1.1
See if we can find ways around the slowbinary.Read
operation taking up a significant amount of time in the decoding process.unsafe
performance enhancements to the package. Only add if it is significant (to be discussed here first).bytes.Buffer
etc.