[logger_olp] Avoid repeated calls to persistent_term:put
logger_otp would call back to persistent_term:put on each iteration even when the mode wouldn't actually change. Even though persistent_term:put guards against changing value to the same avoiding the most expensive operations, it still aquires some locks and does potentially other fairly expensive work. We can avoid this with a simple check in logger_olp to try and update the value only if it has actually changed.
CT Test Results
2 files 70 suites 1h 2m 11s :stopwatch: 1 544 tests 1 299 :white_check_mark: 241 :zzz: 4 :x: 1 715 runs 1 438 :white_check_mark: 273 :zzz: 4 :x:
For more details on these failures, see this check.
Results for commit effc59c0.
:recycle: This comment has been updated with latest results.
To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.
See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.
Artifacts
// Erlang/OTP Github Action Bot
The test failures look unrelated
Merged, thanks for the PR!