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

Signal interfaces extensive allocations #27

Closed
dudk opened this issue Jul 23, 2020 · 3 comments
Closed

Signal interfaces extensive allocations #27

dudk opened this issue Jul 23, 2020 · 3 comments

Comments

@dudk
Copy link
Member

dudk commented Jul 23, 2020

The following methods return an interface values and cause heap allocations which result in additional load on GC:

  • Append
  • AppendSample
  • Slice

There is no real solution to this in current Go. It just should be clear that users can't expect performance of raw Go slices with this methods.

@dudk
Copy link
Member Author

dudk commented Jul 23, 2020

Memory profile of mixer with 100 lines that was using AppendSample function.

@dudk
Copy link
Member Author

dudk commented Sep 14, 2020

Thу solution to extensive allocations is to avoid the return of interfaces where possible. Only Slice function should still return result because it's aligned with semantics - new signal buffer is returned.

@dudk
Copy link
Member Author

dudk commented Oct 22, 2020

This was fixed in #32

@dudk dudk closed this as completed Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant