-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Very slow on a Pi 1 #12
Comments
I sprinkled a load of new = time.perf_counter(); print(f"Took {new-last}"); last = new lines throughout the code, and after slightly refactoring this bit: new = time.perf_counter(); print(f"Took {new-last}"); last = new
richtext = rpipins(options)
new = time.perf_counter();print(f"Took {new-last}"); last = new
rich.print(richtext)
new = time.perf_counter();print(f"Took {new-last}"); last = new and running |
Hmmm, and I just created a venv and pip-installed the latest version of |
I wonder if there's any means to fallback from rich to something more traditional for performance concerns. rich really is very, very nice but that loading delay is quite egregious. I wonder if we can capture and cache its output somehow, since the pinout is mostly static... |
I've not done any investigation into where / why it's slowing down, but (testing #11 ) on a Raspberry Pi Model 1 B+ (running over SSH to a headless Pi, rather than a directly-attached monitor and keyboard) ...
time python3 -m rpipins
takes 4 secondstime python3 -m rpipins --all
takes 5 secondstime python3 -m rpipins --debug
takes 6.5 secondstime python3 -m rpipins --debug --all
takes 7 seconds (oof!)I'm not using a virtualenv, I'm using the system-python on the latest Raspberry Pi OS Bookworm 32-bit Lite (with
python3-rich
manually installed).And just to rule out
pinctrl
as being the source of the slowdown,time pinctrl get 0-27
takes just 0.02 seconds 🙂The text was updated successfully, but these errors were encountered: