Skip to content

Minor fix for the CompactMap() performance test. #6836

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

Merged

Conversation

proton-lisandro-pin
Copy link
Contributor

@proton-lisandro-pin proton-lisandro-pin commented Jun 2, 2025

What problem are we solving?

#6804

How are we solving the problem?

Per-entry memory usage for CompactMap() is based on TotalAllocs, which is incorrect, as that value measures a cumulative of heap usage - and won't decrease when objects are freeed.

Allocs is instead an accurate representation of actual memory usage at the time metrics are reported. This change allows to better evaluate memory impact for CompactMap changes.

How is the PR tested?

No functional/unit tests are affected.

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

Per-entry memory usage is based on `TotalAllocs`, which is incorrect - that
value is a cummulative of heap usage, which doesn't decrease when objects
are freeed.

`Allocs` is instead an accurate represeentation of actual memory usage
at the time metrics are reported.
@chrislusf chrislusf merged commit 7204731 into seaweedfs:master Jun 3, 2025
6 of 7 checks passed
@proton-lisandro-pin proton-lisandro-pin deleted the needle_perf_test_fix branch June 6, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants