-
Notifications
You must be signed in to change notification settings - Fork 776
Closed
Description
Hello! :-)
I was reading the docs at https://websocket-client.readthedocs.io/en/latest/faq.html#why-is-this-library-slow, and it explains that "please install both numpy and wsaccel, but note that wsaccel can sometimes cause other issues".
This message is way too vague and scared and intrigued me. So I checked the source code:
- I see that
wsaccel
is used in https://github.com/websocket-client/websocket-client/blob/master/websocket/_utils.py and it's used for accelerating UTF8 correctness validation. - I see that both
numpy
andwsaccel
are used in the ABNF library https://github.com/websocket-client/websocket-client/blob/master/websocket/_abnf.py, and that the code prefersnumpy
and ignoreswsaccel
if numpy was found. - As I understand it, the most "heavy" operation is the "mask" XOR stuff that WebSockets do, and which is very slow for big binary data. That's what numpy is the preferred accelerator for. So if I read this correctly, the most important speedup is to have numpy.
- How important is wsaccel's acceleration of UTF-8 validation?
- What are the "other issues" that wsaccel can cause? I have read every issue that mentions wsaccel, and all the docs. There's 1 mention in the docs about "other issues" and 1 mention in a ticket about "other issues" but never what "other issues" means.
I hope this discussion can help the community figure out what libraries to use. For now, I am going to assume that numpy is the best choice and will only install that, due to the vague "other issues" warning about wsaccel. ;-)
oyd11
Metadata
Metadata
Assignees
Labels
No labels