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

Improve performance of fallback mask and unmask functions #856

Merged
merged 3 commits into from Oct 12, 2016
Merged

Improve performance of fallback mask and unmask functions #856

merged 3 commits into from Oct 12, 2016

Conversation

Nibbler999
Copy link
Member

This simple implementation seems to be significantly faster in all benchmarks. Am I missing something?

},
unmask: function(data, mask) {
var maskNum = mask.readUInt32LE(0, true);
var length = data.length;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nibbler999 can you use data.length directly in the for loop? This variable is not very useful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's there because of a regression in node I encountered when working on this - nodejs/node#9006

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ok.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a "remove when fixed" comment?

@lpinca
Copy link
Member

lpinca commented Oct 12, 2016

Apart from the comment above (add a reference to the node issue) this LGTM, big +1.

@lpinca lpinca merged commit 03847d3 into websockets:master Oct 12, 2016
@Nibbler999 Nibbler999 deleted the perf-mask-fallback branch October 13, 2016 11:21
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

Successfully merging this pull request may close these issues.

None yet

2 participants