-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Delegate methods to avoid copying NSData messages #424
Comments
Both of these are a very good addition, but I think we can do better than this, specifically for I am curious on the internal impact of the receiving end as well, since we try our best to never copy anything unless we have to, meaning that if you have an optimization for these - we should merge it without even asking whether someone wants to have a copy of received data or not. |
We have been using our patched version of SocketRocket 0.5.0 for quite some time, and we do implement the delegate method to skip making a defensive copy of the NSData received over the web socket. While I'm sure the original maintainers had good reason for making the copy, skipping it has not caused us any problems, and has resulted in noticeably better performance for us. Do you want me to submit a PR that simply removes the call to |
I have a PR that I would like to submit, which adds
SRWebSocketDelegate
methods to allow the delegate to choose whether to copy the NSData messages received over the web socket:We have been using a customized version of SocketRocket based on
0.5.0
that uses these methods to disable the copying of the web socket messages, which has brought us noticeable performance gains. I wanted to submit our changes back as a PR, but theSRDelegateController
API has been added in more recent versions of the library. This calls delegate methods asynchronously, so there doesn't seem to be a preferred way to have delegate methods that return values. So I have two questions:The text was updated successfully, but these errors were encountered: