There are some performance issues that may be helped through some micro-optimization. As a note, the Python version context for this issue is 3.9 because that is what WLAN Pi ships with.
Constructs to look for:
Loop-invariant statements.
Utilize comprehensions.
Select the right Data Structures. There is overhead with certain data tpes.
Function calls have significant overhead. Avoid small functions in hot code. Hot code means using them in a loop. Small utility functions called in a hot loop have performance hits. Need to think about in-lining some of the instructions. Look at pyinline. https://github.com/tonybaloney/pyinline
Before we get started, we need to benchmark and baseline. When we actually make changes, try to make small atomic changes.
There are some performance issues that may be helped through some micro-optimization. As a note, the Python version context for this issue is 3.9 because that is what WLAN Pi ships with.
Constructs to look for:
Before we get started, we need to benchmark and baseline. When we actually make changes, try to make small atomic changes.
Use https://github.com/tonybaloney/perflint to help lint and identify areas to improve performance.
Anti patterns to review: https://github.com/tonybaloney/anti-patterns
Use https://github.com/plasma-umass/scalene to help with profiling profiler
Originally posted by @joshschmelzle in https://github.com/WLAN-Pi/wlanpi-profiler/issues/103#issuecomment-1285485633