@mui/internal-benchmark 0.0.3-canary.12 → 0.0.3-canary.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +6 -8
- package/package.json +2 -2
- package/reactRecording.d.mts +1 -1
package/index.mjs
CHANGED
|
@@ -206,17 +206,15 @@ export function benchmark(name, renderFn, interactionOrOptions, maybeOptions) {
|
|
|
206
206
|
|
|
207
207
|
// Paint timings are recorded as one harness-owned `bench:paint` metric: the default sentinel
|
|
208
208
|
// is the base series (`bench:paint`) and named `elementtiming` markers are sub-series
|
|
209
|
-
// (`bench:paint#grid-header`, …), all sharing a single definition.
|
|
210
|
-
//
|
|
209
|
+
// (`bench:paint#grid-header`, …), all sharing a single definition. Paint is informational (no
|
|
210
|
+
// alarm): it dominates each test's total duration, so a per-test paint alarm just duplicates the
|
|
211
|
+
// Duration regression signal and floods the report on any broadly-regressed run.
|
|
211
212
|
const paint = new ScalarMetric({
|
|
212
213
|
name: 'bench:paint',
|
|
213
214
|
format: {
|
|
214
215
|
style: 'unit',
|
|
215
216
|
unit: 'millisecond',
|
|
216
217
|
maximumFractionDigits: 2
|
|
217
|
-
},
|
|
218
|
-
alarm: {
|
|
219
|
-
error: 0.2
|
|
220
218
|
}
|
|
221
219
|
});
|
|
222
220
|
if (typeof window.gc !== 'function') {
|
|
@@ -286,13 +284,13 @@ export function benchmark(name, renderFn, interactionOrOptions, maybeOptions) {
|
|
|
286
284
|
if (!isWarmup) {
|
|
287
285
|
for (const entry of timing.elementEntries) {
|
|
288
286
|
// Skip paints that happened while recording was paused. Attribute by the paint's
|
|
289
|
-
// `
|
|
290
|
-
if (!recording.activeAt(entry.
|
|
287
|
+
// `paintTime`, not by when the observer callback fired (which can lag the paint).
|
|
288
|
+
if (!recording.activeAt(entry.paintTime)) {
|
|
291
289
|
continue;
|
|
292
290
|
}
|
|
293
291
|
// The default sentinel is the base series; named markers become sub-series.
|
|
294
292
|
const id = entry.identifier === 'default' ? undefined : entry.identifier;
|
|
295
|
-
paint.record(entry.
|
|
293
|
+
paint.record(entry.paintTime - iterationStart, id !== undefined ? {
|
|
296
294
|
id
|
|
297
295
|
} : undefined);
|
|
298
296
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-benchmark",
|
|
3
|
-
"version": "0.0.3-canary.
|
|
3
|
+
"version": "0.0.3-canary.14",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Benchmark utilities for MUI projects. Internal package.",
|
|
6
6
|
"repository": {
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitSha": "
|
|
71
|
+
"gitSha": "b3537f3ae9a46001df4b894cde740a0d44595786"
|
|
72
72
|
}
|
package/reactRecording.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ export interface ReactRecordingControls {
|
|
|
5
5
|
readonly hadEmptyActiveWindow: boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Whether recording was active at `time` (a `performance.now()` timestamp). Paint entries are
|
|
8
|
-
* observed asynchronously, so they are attributed by their `
|
|
8
|
+
* observed asynchronously, so they are attributed by their `paintTime` rather than by the
|
|
9
9
|
* recording state at the moment the observer callback happens to fire.
|
|
10
10
|
*/
|
|
11
11
|
activeAt(time: number): boolean;
|