Skip to content

Commit ff2b4ab

Browse files
IvanGoncharovyaacovCR
authored andcommitted
benchmark: replace failing on context switching with warning (#3625)
1 parent 04db3c0 commit ff2b4ab

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

resources/benchmark.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ function collectSamples(modulePath: string) {
122122

123123
if (sample.involuntaryContextSwitches > 0) {
124124
numOfConsequentlyRejectedSamples++;
125-
if (numOfConsequentlyRejectedSamples > 5) {
126-
throw Error(
127-
'Can not sample benchmark due to 5 consequent runs beings rejected because of context switching',
125+
if (numOfConsequentlyRejectedSamples === 5) {
126+
console.error(
127+
yellow(
128+
' Five or more consequent runs beings rejected because of context switching.\n' +
129+
' Measurement can take a significantly longer time and its correctness can also be impacted.',
130+
),
128131
);
129132
}
130133
continue;

0 commit comments

Comments
 (0)