-
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
Optimisation pass #93
Conversation
…reduce initialisation guards
cc1e033
to
b47d865
Compare
Is this ready for review? |
No, I still need to do some formal benchmarking and record the results here. Also need to do some playtesting. |
01e65f9
to
c5cb949
Compare
Updated the description with my benchmark results, overall very good performance uplifts. Getting basically true 1000Hz polling without having to disable all LEDs. |
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.
Fantastic work. Tested and working on my phoenixwan (full speed w/ LEDs enabled), still awaiting test results from controllers with poorer sensor alignment, but will merge anyway since there is an objective increase in several metrics. Thanks for the PR!
Optimisation pass, primarily aimed at reducing the number of RGB update calls and reducing code size.
Mostly targets IIDX mode due to TT misfiring/misinputs from low polling rates, SDVX mode doesn't really have much going on except for the ADC stuff.
Benchmarks
Binary size
Using
-O2
. Compiled with avr-gcc 14.1.0 using pre-compiled builds from here. Sizes obtained by runningavr-objdump -Pmem-usage beef.elf
.master
optimisation-pass
Polling rate
Tested by using Gamepadla and having an incrementing counter on the X joystick axis, averaged over five tests. Using 6000 samples. LED refresh rate is set to 60Hz.
master
optimisation-pass
*Off refers to the off lighting mode, not the "disable LED" toggle.
The fact that we see a 1% uplift in HID (standby) mode likely shows a real optimisation in our code, rather than it just coming from reducing the number of times we update the LEDs.
Changes
Disable
RGB modes performs worse than disabling all LEDsBEEF_LED_REFRESH
value from 240 to 60RING_LIGHT_LEDS
/LIGHT_BAR_LEDS
are set to 0Ticker
,BreathingPattern
classes to reduce code size and branching code