-
Notifications
You must be signed in to change notification settings - Fork 489
Return early when channels mismatch to skip expensive msgpack decoding #107
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
Conversation
|
LGTM 👍 Could you squash it into one commit please? |
658b0d4 to
5bcb29d
Compare
|
@darrachequesne squashed! Thanks for quick reply! (hopefully, version bump is preferred... :p) |
| } else { // Fallback to slow indexOf impl for older Node.js | ||
| this.channelMatches = function (messageChannel, subscribedChannel) { | ||
| return messageChannel.indexOf(subscribedChannel) === 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just using substr ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rauchg I referred to https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
I leant something from your suggestion, thank you!
|
Thanks! |
|
@rauchg Thanks a lot! Also, could you tell me when a new version will be released? :) |
|
@darrachequesne @nkzawa @rauchg sorry for indiscriminate pinging... Some time has passed. Hopefully, I rather want this modification to be officially released. |
Hopefully, the title says all.
Well, we're using a lot of namespaces. and there is performance problem.