Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More performance enhancements #71

Closed
1 of 3 tasks
azul3d-bot opened this issue Mar 6, 2016 · 2 comments
Closed
1 of 3 tasks

More performance enhancements #71

azul3d-bot opened this issue Mar 6, 2016 · 2 comments

Comments

@azul3d-bot
Copy link

Issue by slimsag
Wednesday Oct 01, 2014 at 19:05 GMT
Originally opened as azul3d-legacy/audio-wav#8


Moving the previous discussion from azul3d-legacy/audio#5 to here.

  • v1.1 See if we can find ways around the slow binary.Read operation taking up a significant amount of time in the decoding process.
  • Investigate how complex/much code it would be to add unsafe performance enhancements to the package. Only add if it is significant (to be discussed here first).
  • There are many small read operations, try performing them in large chunks (i.e. read 1024 bytes at a time) or try a bytes.Buffer etc.
@azul3d-bot
Copy link
Author

Comment by slimsag
Friday Oct 10, 2014 at 09:08 GMT


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%     

@azul3d-bot azul3d-bot added this to the Version 2 milestone Mar 6, 2016
@mewmew
Copy link
Member

mewmew commented Mar 7, 2016

This issue seems to be a duplicate of #67

The issue can therefore be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants