-
Notifications
You must be signed in to change notification settings - Fork 58
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 mypyc to compile modules #25
Conversation
@@ -0,0 +1,25 @@ | |||
[mypy] |
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.
The basic idea here is to completely disallow all dynamic typing in these modules. This ensures mypyc has all the information needed to provide the best possible performance improvements.
@@ -0,0 +1,48 @@ | |||
from typing import Callable, Dict, List, Optional |
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.
stubs/ just contains the minimal stubs needed to satisfy mypy and eliminate all dynamic typing. There are some cheats and such in here, but that shouldn't be an issue.
@@ -0,0 +1,23 @@ | |||
name: CI |
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'm guessing this won't run on this repository until it's actually been merged initially.
You can see the CI run on my fork though: https://github.com/Dreamsorcerer/bthidhub/commits/master
Hi Sam, I won't be able to look at the pull request for the next few weeks, but I appreciate your contributions. I have invited you as a contributor to this repository, so feel free to merge your changes to the main branch |
@ruundii Unfortunately, I've just realised it doesn't really resolve the lag issue after all (though may still be a good idea overall). When I start the application, there is no noticeable lag. If I disconnect my laptop and reconnect it (from the laptop's BT settings), then often the lag appears after reconnecting. Restarting the app will often go back to being lag-free. Any ideas what might be causing this lag after reconnection? I've tried profiling the app, but I don't see any major differences. Maybe there is more time spent in asyncio_glib/glib_selector.py, but I'm not too convinced the problem is there, it might be an issue not exposed by the profiler. |
from when i was developing and profiling it I remember few things which may cause issues
|
I think you've got it. It appears that it sets to master on startup, but doesn't do it again when the device reconnects. I'll have a look tomorrow and create a PR to fix it. |
Nevermind, that only took 5 mins. :P |
I'm happy to merge the other PRs, but I think this one is probably best if tested by someone other than me first. Also, when you do have some time, it'd be a great help if you could take a look at #21. This is the last issue causing me major problems, and the problem appears to be in the forked bluez, which is not something I know how to debug. |
This compiles the modules which are involved in processing BT/HID events in order to increase performance.
Fixes #24