generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't merge scopes that have different data (#102)
Previously we would merge all scopes that have the same `id`, but if you have multiple scopes after each that have same `id` but different dynamic `data` field they would be merged together and we wouldn't display the `data` field. This is something we ran into in our codebase that made it harder to see why a certain heavy operation was happening as we were missing the context for it. Which we did specify but was merged together and not shown here as merging scopes is on by default (and is a general good idea). Adds a simple visual test for in the imgui and egui clients. Resolves: #73 ## Example This is how it looks like now: ![image](https://user-images.githubusercontent.com/1262692/196470164-64076531-647c-48dc-84d3-7bb1a3d502a6.png) from the following code: ```rust // test to verify these spikes timers are not merged together as they have different data for (name, ms) in [("First".to_string(), 20), ("Second".to_string(), 15)] { puffin::profile_scope!("Spike", name); std::thread::sleep(std::time::Duration::from_millis(ms)) } // these are however fine to merge together as data is the same for (_name, ms) in [("First".to_string(), 20), ("Second".to_string(), 15)] { puffin::profile_scope!("Spike"); std::thread::sleep(std::time::Duration::from_millis(ms)) } ``` Before this PR this would have been a single "4x Spike"
- Loading branch information
Showing
4 changed files
with
66 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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