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

Websocket XOR performance improved. Fixes #686 #687

Merged
merged 1 commit into from
Dec 18, 2015
Merged

Websocket XOR performance improved. Fixes #686 #687

merged 1 commit into from
Dec 18, 2015

Conversation

socketpair
Copy link
Contributor

Both cython and pure python-based.

@@ -172,6 +173,7 @@ def WebSocketParser(out, buf):
Message(OPCODE_BINARY, data, ''), len(data))


native_byteorder = sys.byteorder
Copy link
Member

Choose a reason for hiding this comment

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

sys.byteorder is little (at least for me), while iirc websocket uses network one which is big. Could anyone confirm this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in that operation, byte order is irrelevant, since actual numeric value is not used in that code. i.e. byte representation of xored result does not depend on that order.

But, it is a question, which order is optimal to internal bigint logic in python.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, ok. Thanks!

@asvetlov
Copy link
Member

Please report about performance improvement.
I want to mention it in release notes.

Both cython and pure python-based.
@socketpair
Copy link
Contributor Author

@asvetlov

Please report about performance improvement.
In which form ?

I has changed pure-python and cython code. seems both should be faster.

P.S. Also, thaere are no tests that tests xor correctness

@socketpair
Copy link
Contributor Author

@asvetlov I cannot measure performance increase correctly. It varies from 1.2 to 40 for both Python and Cython implementations....

@asvetlov
Copy link
Member

@socketpair Ok.
Thanks.

asvetlov added a commit that referenced this pull request Dec 18, 2015
Weboscket XOR performance improved. Fixes #686
@asvetlov asvetlov merged commit 88d006c into aio-libs:master Dec 18, 2015
@socketpair socketpair changed the title Weboscket XOR performance improved. Fixes #686 Websocket XOR performance improved. Fixes #686 Feb 18, 2016
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants