diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-04 20:09:03 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-19 08:41:37 +0900 |
commit | 62ec908efc0ea2390920d319c51984f51ce450bd (patch) | |
tree | 52f8ca9f002c5527beef7e6523bb628d34f139c4 | |
parent | e5175246c809695dff2aff4b50f4ac5c0e6c2f46 (diff) | |
download | libquotient-62ec908efc0ea2390920d319c51984f51ce450bd.tar.gz libquotient-62ec908efc0ea2390920d319c51984f51ce450bd.zip |
profilerMinNsecs(): Fix a misnomer - it's PROFILER_LOG_USECS now - and document it
-rw-r--r-- | CONTRIBUTING.md | 8 | ||||
-rw-r--r-- | lib/logging.h | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d50dc157..6ee39eec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -237,6 +237,14 @@ We want the software to have decent performance for typical users. At the same t Having said that, there's always a trade-off between various attributes; in particular, readability and maintainability of the code is more important than squeezing every bit out of that clumsy algorithm. Beware of premature optimization and have profiling data around before going into some hardcore optimization. +Speaking of profiling logs (see README.md on how to turn them on) - in order +to reduce small timespan logging spam, there's a default limit of at least +200 microseconds to log most operations with the PROFILER +(aka libqmatrixclient.profile.debug) logging category. You can override this +limit by passing the new value (in microseconds) in PROFILER_LOG_USECS to +the compiler. In the future, this parameter will be made changeable at runtime +_if_ needed. + ## How to check proposed changes before submitting them Checking the code on at least one configuration is essential; if you only have diff --git a/lib/logging.h b/lib/logging.h index 6c93ca79..a3a65887 100644 --- a/lib/logging.h +++ b/lib/logging.h @@ -69,11 +69,11 @@ namespace QMatrixClient inline qint64 profilerMinNsecs() { return - #ifdef PROFILER_LOG_MIN_MS - PROFILER_LOG_MIN_MS - #else +#ifdef PROFILER_LOG_USECS + PROFILER_LOG_USECS +#else 200 - #endif +#endif * 1000; } } |