Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[logger_olp] Avoid repeated calls to persistent_term:put #8628

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

michalmuskala
Copy link
Contributor

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.

`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 michalmuskala changed the base branch from master to maint June 29, 2024 10:18
Copy link
Contributor

github-actions bot commented Jun 29, 2024

CT Test Results

    2 files     70 suites   1h 2m 11s ⏱️
1 544 tests 1 299 ✅ 241 💤 4 ❌
1 715 runs  1 438 ✅ 273 💤 4 ❌

For more details on these failures, see this check.

Results for commit effc59c.

♻️ 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

@michalmuskala
Copy link
Contributor Author

The test failures look unrelated

@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Jul 1, 2024
@jhogberg jhogberg self-assigned this Jul 1, 2024
@jhogberg jhogberg added the testing currently being tested, tag is used by OTP internal CI label Jul 1, 2024
@jhogberg jhogberg merged commit 09f10d3 into erlang:maint Jul 9, 2024
15 of 17 checks passed
@jhogberg
Copy link
Contributor

jhogberg commented Jul 9, 2024

Merged, thanks for the PR!

@michalmuskala michalmuskala deleted the logger-olp branch July 10, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants