-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to make performance test tolerant to the device where it is run? #16
Comments
I think this would be a good feature to add :) I can think of some different ways to incorporate this into Option 1: Compare directly to baseline functionThis is similar to your example (test function is faster than 50x the baseline): const options = {
iterations: 1000,
baseline: await measure(
() => JSON.parse('{"config":[{"key":"email","value":"email"},{"key":"mqiPassword","value":"mqiPassword"}]}'),
{ iterations: 1000 },
),
};
const measurement = await benchmark.record(
() => cloneAndSanitize(test),
{ ...options, baselineMultiplier: 50 },
); Let's say that
Option 2: Compare baseline function with itself on different systemsconst options = {
iterations: 1000,
baseline: {
reference: new Measurement([10, 11, 20, ...]), // snapshot from `measure` on some test system
current: await measure(
() => JSON.parse('{"config":[{"key":"email","value":"email"},{"key":"mqiPassword","value":"mqiPassword"}]}'),
{ iterations: 1000 },
),
};
const measurement = await benchmark.record(
() => cloneAndSanitize(test),
{ ...options, meanUnder: 100 },
); Let's say
|
I did not find a way to make it tolerant and came up with my solution to measure the performance relatively to the performance of built-in
JSON.parse
.Any other idea/recommendation?
The text was updated successfully, but these errors were encountered: