Skip to content

Commit

Permalink
Remove performance logging from non-iso-calendars.js staging test
Browse files Browse the repository at this point in the history
The performance logging was left over from when this test lived in the
proposal-temporal repo. It was already switched off anyway.
  • Loading branch information
ptomato committed Apr 9, 2024
1 parent 6c60904 commit 68ed234
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions test/staging/Intl402/Temporal/old/non-iso-calendars.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ var fromWithCases = {
year1: RangeError
}
};
var logPerf = false;
var totalNow = 0;
for (var [id, tests] of Object.entries(fromWithCases)) {
var dates = {
year2000: Temporal.PlainDate.from("2000-01-01"),
Expand All @@ -341,7 +339,6 @@ for (var [id, tests] of Object.entries(fromWithCases)) {
var values = tests[name];
var errorExpected = values === RangeError;
if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) {
var now = globalThis.performance ? globalThis.performance.now() : Date.now();
if (errorExpected) {
assert.throws(RangeError, () => {
var inCal = date.withCalendar(id);
Expand Down Expand Up @@ -410,13 +407,8 @@ for (var [id, tests] of Object.entries(fromWithCases)) {
monthCode: values.monthCode,
year: values.year
}));
var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now;
totalNow += ms;
if (logPerf)
console.log(`from: ${ id } ${ name }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`);
};
if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) {
var now = globalThis.performance ? globalThis.performance.now() : Date.now();
var inCal = date.withCalendar(id);
if (errorExpected) {
assert.throws(RangeError, () => inCal.with({ day: 1 }).year);
Expand All @@ -436,10 +428,6 @@ for (var [id, tests] of Object.entries(fromWithCases)) {
assert.sameValue(`${ t } year: ${ afterWithYear.year }`, `${ t } year: 2220`);
assert.sameValue(`${ t } month: ${ afterWithYear.month }`, `${ t } month: 1`);
assert.sameValue(`${ t } day: ${ afterWithYear.day }`, `${ t } day: 1`);
var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now;
totalNow += ms;
if (logPerf)
console.log(`with: ${ id } ${ name }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`);
};
}
}
Expand Down Expand Up @@ -665,7 +653,6 @@ for (var id of calendars) {
var values = results[id];
duration = Temporal.Duration.from(duration);
if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) {
var now = globalThis.performance ? globalThis.performance.now() : Date.now();
if (values === RangeError) {
assert.throws(RangeError, () => Temporal.PlainDate.from({
...startDate,
Expand Down Expand Up @@ -721,10 +708,6 @@ for (var id of calendars) {
assert.sameValue(`subtract from end-of-month ${ unit } ${ id } month: ${ startReverseNextDay.month }`, `subtract from end-of-month ${ unit } ${ id } month: ${ start.month }`);
assert.sameValue(`subtract from end-of-month ${ unit } ${ id } monthCode: ${ startReverseNextDay.monthCode }`, `subtract from end-of-month ${ unit } ${ id } monthCode: ${ start.monthCode }`);
}
var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now;
totalNow += ms;
if (logPerf)
console.log(`${ id } add ${ duration }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`);
};
}
}
Expand Down Expand Up @@ -1097,7 +1080,6 @@ for (var id of calendars) {
}
};
if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) {
var now = globalThis.performance ? globalThis.performance.now() : Date.now();
var {monthsInYear} = date;
assert.sameValue(monthsInYear, days.length);
for (var i = monthsInYear, leapMonthIndex = undefined, monthStart = undefined; i >= 1; i--) {
Expand Down Expand Up @@ -1141,10 +1123,6 @@ for (var id of calendars) {
var oneDayPastMonthEnd = monthStart.with({ day: daysInMonth + 1 });
assert.sameValue(oneDayPastMonthEnd.day, daysInMonth);
}
var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now;
totalNow += ms;
if (logPerf)
console.log(`${ id } months check ${ id }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`);
};
}
var monthDayCases = [
Expand Down

0 comments on commit 68ed234

Please sign in to comment.