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

[Feature] Profiling #1565

Merged
merged 3 commits into from
Jan 9, 2023
Merged

[Feature] Profiling #1565

merged 3 commits into from
Jan 9, 2023

Conversation

bungoboingo
Copy link
Contributor

@bungoboingo bungoboingo commented Nov 30, 2022

This PR introduces basic support for tracing as a feature of iced_winit. For now, only Chrome traces are supported, but I have plans to add support for Tracy in the near future!

Simply enable iced/chrome-trace feature to generate a trace file at the location of your current executable, e.g.:
target/debug(or release)/traces/package_trace_timestamp.json.

Any traces you include using the tracing crate will be included in addition to builtin things as frame time, application events, renderer draw calls for either wgpu or glow, etc.

E.g., in your application:

let _ = tracing::info_span!("MyTrace").entered(); // span ref dropped at end of scope

Screenshot from 2022-12-24 19-25-17

Chrome traces can be viewed at ui.perfetto.dev by opening the JSON file in the viewer.

Let me know what you think, thanks!

@bungoboingo bungoboingo marked this pull request as ready for review November 30, 2022 06:37
@bungoboingo bungoboingo marked this pull request as draft December 21, 2022 04:42
@bungoboingo bungoboingo changed the title [Feature] Profiling [WIP - Feature] Basic profiling Dec 21, 2022
@bungoboingo bungoboingo force-pushed the feat/tracing branch 2 times, most recently from 7f8acbf to 60f6e7b Compare December 25, 2022 03:11
@bungoboingo bungoboingo marked this pull request as ready for review December 25, 2022 03:19
@bungoboingo bungoboingo changed the title [WIP - Feature] Basic profiling [Feature] Profiling Dec 25, 2022
@bungoboingo
Copy link
Contributor Author

bungoboingo commented Dec 25, 2022

Updated this re: a discussion on restructuring this to just be a simple feature of iced_winit.

Changes in 60f6e7b:

  1. Removed iced_profiling crate, adjusted all dependencies to just rely on the base tracing crate.
  2. Changed the location of generated trace files to be within the current executable's path.
  3. Restructured features a bit for clarity/to avoid repetition.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks 🙇

@hecrj hecrj enabled auto-merge January 9, 2023 17:58
@hecrj hecrj merged commit 07d755c into iced-rs:master Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants