Profiler
Measure and visualize multiple quantities over time.
Configured to measure a function's execution duration by default, but can be customized to measure anything.
Integrates 0b5vr's tweakpane-plugin-profiler.
See <FpsGraph>
for a simpler alternative optimized for framerate visualization.
Usage outside of a <Pane>
component will implicitly wrap the profiler in <Pane position="inline">
.
Note that Svelte Tweakpane UI embeds a functionally identical fork of the plugin with build optimizations.
bindablereadonlyoptional | |
Description | Function handle that wraps another function to measure its execution duration. If you want to measure something other than execution duration, customize |
---|---|
Type | ProfilerMeasure |
Example | measure('Hard Work', () => { ... }) ; |
bindableasyncreadonlyoptional | |
Description | Async variation of function handle that wraps another function to measure its execution duration. |
---|---|
Type | ProfilerMeasureAsync |
Example | measureAsync('Hard Work', async () => { ... }) ; |
optional | |
Description | Number of duration samples from which to calculate the delta value when |
---|---|
Type | number |
Default | 30 |
optional | |
Description | How to calculate the delta value.
|
---|---|
Type | ProfilerCalcMode |
Default | 'mean' |
optional | |
Description | Label suffix for the delta values shown in the control. Possibly useful if you're using a custom |
---|---|
Type | string |
Default | 'ms' |
optional | |
Description | Precision of the delta values shown in the control. |
---|---|
Type | number |
Default | 2 |
optional | |
Description | Milliseconds between updates to the profiler visualization and delta label text. Note that this does not affect the internal sampling rate of the profiler itself, which is determined by your calls to the bound |
---|---|
Type | number |
Default | 500 |
optional | |
Description | Text displayed next to the profiler visualization. |
---|---|
Type | string |
Default | undefined |
optional | |
Description | Function wrapping the The default is fine for most cases when you want to measure a temporal duration. |
---|---|
Type | { measureStart: () => () => number | Promise<number>; } |
Default | new ProfilerBladeDefaultMeasureHandler() |
optional | |
Description | Determines the horizontal scale and color mapping of the profiler visualization bars. |
---|---|
Type | number |
Default | 16.67 60fps. |
optional | |
Description | Prevent interactivity and gray out the control. |
---|---|
Type | boolean |
Default | false |
optional | |
Description | Custom color scheme. |
---|---|
Type | Theme |
Default | undefined Inherits default Tweakpane theme equivalent to ThemeUtils.presets.standard , or the theme set with setGlobalDefaultTheme() . |
Description | Fires when the overall delta value changes, passing the latest measurement. Note that the values described in the |
---|---|
Type | ProfilerChangeEvent |