Skip to content

Revert usage of hash to select the shard#468

Merged
r1viollet merged 2 commits into
mainfrom
r1viollet/fix_bitset_logic
Nov 5, 2025
Merged

Revert usage of hash to select the shard#468
r1viollet merged 2 commits into
mainfrom
r1viollet/fix_bitset_logic

Conversation

@r1viollet

@r1viollet r1viollet commented Nov 5, 2025

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • In commit 6bfad54 I made a mistake where I broke the sharding logic
  • Minor cleanup on unused variables
  • Increase probing to 64 & load factor
    The assumption is that users care more about invesitgating leaks. This is already not great in perf.

Motivation

Go back to putting addresses in close addresses in the same shard as this could be causing issues in memory usage.

Additional Notes

NA

How to test the change?

Once this is merged in main, I expect relenv deployments will be healthy.

@r1viollet
r1viollet requested a review from nsavoire as a code owner November 5, 2025 16:17
nsavoire
nsavoire previously approved these changes Nov 5, 2025
Comment thread test/simple_malloc.cc
}
}
} else {
if (skip_free++ >= options.skip_free) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I remove the skip free ? I don't like skip free it ends up killing my laptop 😄

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip free is useful to check that we are able to detect leaks

@pr-commenter

pr-commenter Bot commented Nov 5, 2025

Copy link
Copy Markdown

Benchmark results for collatz

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.22.0+a06d7585.81351106 ddprof 0.22.0+a99eba8a.81353304

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-collatz --preset cpu_only collatz_runner.sh same

@pr-commenter

pr-commenter Bot commented Nov 5, 2025

Copy link
Copy Markdown

Benchmark results for BadBoggleSolver_run

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.22.0+a06d7585.81351106 ddprof 0.22.0+a99eba8a.81353304

Summary

Found 0 performance improvements and 1 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics.

scenario Δ mean execution_time
scenario:ddprof -S bench-bad-boggle-solver BadBoggleSolver_run work 1000 worse
[+21.846ms; +30.340ms] or [+1.111%; +1.543%]
See unchanged results

- In 6bfad54 I made a mistake where I broke the sharding logic.
- Minor cleanup on unused variables
- We leak the address tracking structure for large allocations from the AddressBitset::init function
- Minor const correctness fix
@r1viollet
r1viollet force-pushed the r1viollet/fix_bitset_logic branch from 5b6d588 to a99eba8 Compare November 5, 2025 16:59
@r1viollet
r1viollet requested a review from nsavoire November 5, 2025 17:02
@r1viollet
r1viollet merged commit 888bec4 into main Nov 5, 2025
1 of 2 checks passed
@r1viollet
r1viollet deleted the r1viollet/fix_bitset_logic branch November 5, 2025 17:15
Comment thread test/simple_malloc.cc
}
}
} else {
if (skip_free++ >= options.skip_free) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip free is useful to check that we are able to detect leaks

Comment thread test/simple_malloc.cc
skip_free = 0;
if (options.keep_live_allocations > 0) {
if (p2 != nullptr) {
live_allocations.push_back(p2);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trigger allocations in the middle of the loop allocations, which could make harder to understand exactly what is going on.

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