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

Avoid lock / unlock for some function call #141

Open
leslie-wang opened this issue Dec 27, 2022 · 0 comments
Open

Avoid lock / unlock for some function call #141

leslie-wang opened this issue Dec 27, 2022 · 0 comments

Comments

@leslie-wang
Copy link

@xlab I'm trying to compare the auto-generated code https://github.com/leslie-wang/opus-go/blob/latest-c-for-go/opus/opus.go and the manual generated one https://github.com/hraban/opus/blob/v2/encoder.go, seems like the auto generated one calls function copyPInt16Bytes twice, in which lock/unlock always happen. It means everytime calling c function will lock/unlock which is an expensive operation. Actually the earlier version https://github.com/xlab/opus-go/blob/master/opus/opus.go won't do lock/unlock either. Is there any rational behind it? Is it possible to avoid it?

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