Repository navigation
Instrumented profiler: FLING_PROFILE_SCOPE and --profile - #256
Merged
Merged
Conversation
A scope times a block on any thread. Scopes with one name add up, with a call count and the slowest call. --profile turns it on and prints a table at exit (works with --null-render, --offscreen and a window). Off, a scope costs one atomic load; shipping builds remove it. Scopes added: the main loop (input, world update, present), the snapshot system, the G-buffer pass steps, the pass recording and the wait for the GPU. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017NN37Q2jpV81xZaX3ocojK
-DFLING_PROFILER=AUTO|ON|OFF (default AUTO: on unless DEFINE_SHIPPING). It sets WITH_PROFILER (0 or 1, PUBLIC on Core). With 0 there is no Profiler class, FLING_PROFILE_SCOPE is nothing, and --profile exits with code 3. ON profiles a shipping build locally; OFF removes it from a dev build. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017NN37Q2jpV81xZaX3ocojK
Keep both the profiler scopes/option and main's occlusion culling. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What
A small instrumented profiler, so a run can say where its time goes.
FLING_PROFILE_SCOPE("Name")(Profiler.h, Core) times a block on any thread. Scopes with one name add up, with a call count, a total, an average and the slowest call.--profileturns it on and prints a table at exit. It works with--null-render,--offscreenand a window.Graphics.PublishSnapshot, the G-buffer pass steps, the pass recording and the wait for the GPU.Example (
Sandbox --offscreen --unattended --profile --frames 300):Why
Linux
perfis often blocked (perf_event_paranoid), and it cannot see the engine's own phases. This found the slowdown that the next PR fixes.Tests
ProfilerTests(new): scopes count only while on, and add up across threads.ctest: 685/685 pass.Notes
--play: without it the Sandbox starts the editor, which runs no ticks.🤖 Generated with Claude Code
https://claude.ai/code/session_017NN37Q2jpV81xZaX3ocojK