digitalsputnik / ApolloFirmware

Micropython software for the Apollo lamps
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Test & Time boot times using new main script #21

Closed MJoosep closed 2 years ago

MJoosep commented 2 years ago

Create a new main python script with most functionality discarded. New main should only have apa led control and an on_off handler and should become a new base to build upon. The purpose of this is to try to shorten current boot times (8 seconds) to avoid user frustration when setting up lamps.

Testing should follow these steps:

MJoosep commented 2 years ago

Created a new main script with most functionality pulled out. New script has an on/off handler to detect power button presses. Currently while the status is set to on, first apa led turns green, if status is off the led turns off aswell.

Added Timing to the main script with automatic result saving. Results are saved as tuples in a list of results, tuples contain five time values (in milliseconds) which are:

The list is then saved in Data/_boot_time_analysis.py and can be either exported using export_boot_time_analysis() command in REPL or copying the data directly from the file.

Created a sample test data overview in Google Colab, where the exported values can be pasted to see boot times on a graph. Google Colab Link: https://colab.research.google.com/drive/1BnqW0UsUutiGC1ryNl1bdpl6BUBHhxwW?usp=sharing

MJoosep commented 2 years ago

While testing the times manually without automatic data exporting, interesting patterns emerged.

Saving data takes 38-59 milliseconds. With each save the time increases about 0.5ms until it reaches 59. When 59 milliseconds is reached and a new save is initiated it takes around 2500ms to complete a save, after which the save time goes back down to 38.

Loading has taken anywhere from 110 to 140ms (figures that could probably be improved)

Total boot time (when the script end is reached) has taken anywhere from 2586ms to 2853ms based on initial testing