-
Notifications
You must be signed in to change notification settings - Fork 98
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
use orjson instead of json #175
base: dev
Are you sure you want to change the base?
Conversation
… spends a lot of time munging json and orjson is fast at that.
I think this is a good change. Some minor nits above. |
…lso use writelines() in a couple places.
Tested with an RA2 select system 👍 |
Your Lutron lights are approaching the speed of light now! 🏎💨 I should note I'm testing on QSX. |
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.
I don't know if this is going to make a noticeable difference because the CPU running pylutron_caseta should be much faster than the CPU in the bridge, or at least that's the case for Caseta.
Might make a difference for some single board systems, then again the pure Python JSON implementation should be an order of magnitude slower or worse if the hub has implemented it in native code |
The hub uses a compiled language (golang). It'll be pretty fast, even on a much slower CPU. |
Use orjson instead of json like home assistant does. pylutron-caseta spends a lot of time munging json and orjson is fast at that. The main compatibility difference between json and orjson is that dumps() returns bytes.