otp icon indicating copy to clipboard operation
otp copied to clipboard

[logger_olp] Avoid repeated calls to persistent_term:put

Open michalmuskala opened this issue 1 year ago • 2 comments

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.

michalmuskala avatar Jun 29 '24 10:06 michalmuskala

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

github-actions[bot] avatar Jun 29 '24 10:06 github-actions[bot]

The test failures look unrelated

michalmuskala avatar Jun 29 '24 15:06 michalmuskala

Merged, thanks for the PR!

jhogberg avatar Jul 09 '24 15:07 jhogberg