-
-
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
Websocket XOR performance improved. Fixes #686 #687
Conversation
@@ -172,6 +173,7 @@ def WebSocketParser(out, buf): | |||
Message(OPCODE_BINARY, data, ''), len(data)) | |||
|
|||
|
|||
native_byteorder = sys.byteorder |
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.
sys.byteorder
is little (at least for me), while iirc websocket uses network one which is big. Could anyone confirm this?
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.
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.
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.
Ah, ok. Thanks!
Please report about performance improvement. |
Both cython and pure python-based.
I has changed pure-python and cython code. seems both should be faster. P.S. Also, thaere are no tests that tests xor correctness |
@asvetlov I cannot measure performance increase correctly. It varies from 1.2 to 40 for both Python and Cython implementations.... |
@socketpair Ok. |
Weboscket XOR performance improved. Fixes #686
Both cython and pure python-based.