Logging module 0.6.2 runs 10x slower than version 0.2 #20027
Unanswered
jamesquilty
asked this question in
Libraries & Drivers
Replies: 1 comment
|
The 0.6 rewrite simply does more per call than 0.2: Quick wins: call |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've been using version 0.2 of the micropython-lib/python-stdlib/logging module, modified by adding a class which writes the messages to a file on microSD card with immediate flushing. I upgraded to version 0.6.2, which added several classes to the logging module to align it with CPython conventions.
I immediately noticed that log messages which were spaced by ~2 ms became spaced by ~20 ms on the console output. While this isn't an immediate performance issue, the code visibly runs slower for no additional functionality which rankles... and Finagle's Law dictates that it will cause some hard-to-debug issues later.
I'm guessing the introduction of several classes is causing the performance hit, but I've yet to profile the logging code but I'll happily accept guidance on how to profile the various calls to methods without creating spurious delay from the profiling.
How much of an issue is slow logging for others?
All reactions