feat(profiling): opt-in dhat heap profiling for desktop binary#515
Open
beruro wants to merge 1 commit into
Open
feat(profiling): opt-in dhat heap profiling for desktop binary#515beruro wants to merge 1 commit into
beruro wants to merge 1 commit into
Conversation
Developer-only, feature-gated (`dhat-heap`) Rust heap profiler: - `dhat_profiling` module wires DHAT as the global allocator, schedules timed captures from env, and flushes the profile on app exit. - `dhat` is an optional dependency; a dedicated `profile.dhat` build profile preserves symbolized backtraces without affecting normal release artifacts. - Add profiling scripts (rust heap + macOS memory) and contributor docs. Never linked or active unless `--features dhat-heap` is explicitly requested, so default and release builds are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dhat-heap) Rust heap profiler for the desktop binary.dhat_profilingmodule installs DHAT as the global allocator, schedules timed captures from env, and flushes the profile on app exit; wired via#[cfg(feature = "dhat-heap")]hooks inlib.rs/main.rs.dhatdependency + dedicatedprofile.dhatbuild profile (inheritsrelease, symbolized) so normal and release builds are unaffected.scripts/dev/profile-rust-heap.sh,scripts/dev/profile-macos-memory.sh, and contributor docs.Safety
#[cfg(feature = "dhat-heap")]; the allocator and thedhatdependency are never linked unless--features dhat-heapis explicitly requested. Default and release builds are unaffected.Test plan
cargo clippy --lib -p org2passes on default features (profiler excluded; no new warnings in changed files).cargo build --profile dhat --features dhat-heapthen runscripts/dev/profile-rust-heap.sh; confirm a dhat capture is produced.dhat.Based on latest
develop.