#141

Avoid lock / unlock for some function call

Openleslie-wangopened 3y ago

@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?

Activity

0

No activity yet.