| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This package serves a container for a collection of useful logic that could be used alongside the core scichart library. At the moment, the utils within it are experimental and are used for demonstration purposes. This is also a work in progress. Let us know if you find it useful or need some guidance.
Related Links:
Description
The PerformanceMeasurementModifier is a powerful tool for measuring and analyzing the performance of SciChart.JS applications. It provides a draggable control bar with various recording and export options, along with a settings dialog for configuration.
The modifier will be shown when opening a fullscreen version of an example.
import { PerformanceMeasurementModifier } from "scichart-addons";
import { EPerformanceMarkType } from "scichart";
// Add the modifier to your chart
const performanceModifier = new PerformanceMeasurementModifier({
// Optional: specify which marks to track from EPerformanceMarkType enum
// By default, all available mark types are tracked
trackedMarkTypes: Object.values(EPerformanceMarkType),
autoInvalidate: false, // Optional: auto-invalidate chart during recording
verbose: false, // Optional: enable verbose logging
});
sciChartSurface.chartModifiers.add(performanceModifier);The control bar appears as a draggable overlay on your chart with the following controls:
Click the settings button to open a dialog with configuration options:
The performance data exported by this modifier can be analyzed using the SciChart Profiler tool:
The modifier tracks performance marks defined in the EPerformanceMarkType enum from the SciChart library. The enum contains various mark types that represent different phases of chart rendering and interaction.
By default, all available mark types from the enum are tracked. You can customize which marks to track by passing specific enum values in the trackedMarkTypes array.
To see all available mark types, use:
console.log(Object.values(EPerformanceMarkType));In addition to the built-in EPerformanceMarkType marks, you can track custom performance marks for application-specific operations. This is useful for measuring performance of your own code that interacts with SciChart.
Custom marks can be added using the PerformanceDebugHelper.mark() method. Marks should come in pairs (Start/End) with matching relatedId:
import { PerformanceDebugHelper } from "scichart";
const appendData = () => {
// Mark the start of a custom operation
const startMark = PerformanceDebugHelper.mark("DataPrepareStart", {
contextId: sciChartSurface.id,
});
// Your custom operation (e.g., data preparation)
const xValues = generateXValues();
const yValues = generateYValues();
// Mark the end of the operation
PerformanceDebugHelper.mark("DataPrepareEnd", {
relatedId: startMark?.detail?.relatedId,
contextId: sciChartSurface.id,
});
xyDataSeries.appendRange(xValues, yValues);
};To track your custom marks with the Performance Measurement Modifier, include the custom mark names (without "Start" or "End" suffix) in the trackedMarkTypes array:
const performanceModifier = new PerformanceMeasurementModifier({
trackedMarkTypes: [
...Object.values(EPerformanceMarkType), // Include all built-in marks
"DataPrepare", // Add your custom mark type
"CustomOperation", // Add more custom marks as needed
],
autoInvalidate: false,
verbose: false,
});The modifier will automatically match your custom marks with their Start/End pairs and include them in the performance measurements and exports.
Note: Custom marks follow the same naming convention as built-in marks - use a descriptive name and append "Start" or "End" when calling PerformanceDebugHelper.mark().
For more details on performance debugging and custom marks, see the Performance Cheat Sheet.
⚠️ Important: Using the Performance Measurement Modifier and the underlying PerformanceDebugHelper adds overhead to your application's execution and memory usage.
Key Considerations:
Best Practices:
For more information about performance debugging overhead, see the Performance Cheat Sheet - Performance Debugging Overhead and Cleanup.
| Back | FazBrowse Home | New Git URL |