Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove verification function from ReactFabricPublicInstance benchmark #48588

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type {
import ReactNativeElement from '../../../../src/private/webapis/dom/nodes/ReactNativeElement';
import ReactFabricHostComponent from '../../../ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent';
import {unstable_benchmark} from '@react-native/fantom';
import nullthrows from 'nullthrows';

// Create fake parameters for the class.
const tag = 11;
Expand All @@ -40,22 +39,4 @@ unstable_benchmark
.add('ReactFabricHostComponent', () => {
// eslint-disable-next-line no-new
new ReactFabricHostComponent(tag, viewConfig, internalInstanceHandle);
})
.verify(([modernImplResults, legacyImplResults]) => {
const minMedian = Math.min(
nullthrows(modernImplResults.latency.p50),
nullthrows(legacyImplResults.latency.p50),
);
const maxMedian = Math.max(
nullthrows(modernImplResults.latency.p50),
nullthrows(legacyImplResults.latency.p50),
);

const medianDifferencePercent = ((maxMedian - minMedian) / minMedian) * 100;
console.log(
`Difference in p50 values between ReactFabricHostComponent and ReactNativeElement is ${medianDifferencePercent.toFixed(2)}%`,
);

// No implementation should be more than 25% slower than the other.
expect(medianDifferencePercent).toBeLessThan(25);
});
Loading