Skip to content

Commit 2e26d41

Browse files
rubennortefacebook-github-bot
authored andcommitted
Add benchmarks for console.timeStamp (facebook#53294)
Summary: Changelog: [internal] Just adding a benchmark for `console.timeStamp`, which in normal circumstances will just measure a no-op. We can force installing the inspector and simulate that we're profiling in Fantom to force `console.timeStamp` to go through the tracing paths for the benchmark. Reviewed By: rshest Differential Revision: D80272873
1 parent 0e6b94f commit 2e26d41

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @fantom_mode opt
87
* @flow strict-local
98
* @format
109
*/
@@ -23,7 +22,7 @@ const clearMarksAndMeasures = () => {
2322
};
2423

2524
Fantom.unstable_benchmark
26-
.suite('Performance API')
25+
.suite('Performance API', {minIterations: 50000, minDuration: 0})
2726
.test(
2827
'mark (default)',
2928
() => {
@@ -135,4 +134,17 @@ Fantom.unstable_benchmark
135134
},
136135
afterEach: clearMarksAndMeasures,
137136
},
138-
);
137+
)
138+
.test('console.timeStamp (defaults)', () => {
139+
console.timeStamp('label');
140+
})
141+
.test('console.timeStamp (all options)', () => {
142+
console.timeStamp(
143+
'label',
144+
100,
145+
300,
146+
'My track',
147+
'My track group',
148+
'primary',
149+
);
150+
});

0 commit comments

Comments
 (0)