feat: Adding a new Client CPU Profiler tab and visualization #369
feat: Adding a new Client CPU Profiler tab and visualization #369codyward-skybox merged 4 commits intomainfrom
Conversation
Quick implementation of profiler scopes flame stream test flame stream relative current iteration, needs some cleanup various cleanup cleanup and visual tweaks midline options Adjustments to normalization pin the lane timings Rename to ClientCPUProfiler minor cleanup detangling changes detangling changes
anthonywongskyboxlabs
left a comment
There was a problem hiding this comment.
Overall makes sense to me, the charts look awesome!
It could probably use a cleanup pass, but not too big of a deal since this is contained to one tab.
| const effectiveDepthLimit = useMemo(() => { | ||
| if (maxVisibleDepth === MAX_DEPTH_ALL) { | ||
| return maxDepth; | ||
| } |
There was a problem hiding this comment.
Nit: Is this check necessary? If true, the Math.min call below would also return maxDepth
There was a problem hiding this comment.
It's used when in the All Depths mode to force using the maxDepth, in that case maxVisibleDepth is effectively invalid and so it fallbacks to maxDepth
| z: 'pathKey', | ||
| fill: (point: FlameChartPoint) => point.laneFill, | ||
| fillOpacity: (point: FlameChartPoint) => 0.1 + Math.sqrt(point.laneRelativeRatio) * 0.5, | ||
| }), |
There was a problem hiding this comment.
Getting some eslint warnings from this call being indented twice.
There was a problem hiding this comment.
I've seen this in other files, I think there's a conflict between eslint and the autoformatting on save
This change adds a new
Client CPU Profilertab which displays our internal CPU Profiler data (driven by the internal whisker profiler).To visualize the data a new
MinecraftProfilerFlameStreamChartcontrol was created. This displays eachscopein a hierarchal list, where each scope has an incoming lane of timing data. This data can be represented as normalized per lane, or absolute relative to the global timings.Each lane has a midline, and a high/low value. By default we display the midline, but you can enable visualizing each lane as a band.
Additional controls exist for setting the timing window, the timing display units (nano/micro/milliseconds) as well as reducing the scope depth if you'd prefer keeping an eye on the higher parent scopes.
whisker_cpu.mp4