rrule-temporal 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -51
- package/dist/index.cjs +1 -6
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +1 -2
- package/dist/src-CNIROjgI.js +2 -0
- package/dist/src-DP31wO2R.cjs +2 -0
- package/dist/totext.cjs +1 -951
- package/dist/totext.js +1 -950
- package/package.json +1 -1
- package/dist/src-B2AIB5jJ.cjs +0 -8389
- package/dist/src-B2XO5sNr.js +0 -8366
package/README.md
CHANGED
|
@@ -305,65 +305,73 @@ Notes
|
|
|
305
305
|
|
|
306
306
|
## Benchmarks
|
|
307
307
|
|
|
308
|
-
COUNT-bound
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
|
317
|
-
|
|
|
318
|
-
|
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
308
|
+
### COUNT-bound queries
|
|
309
|
+
|
|
310
|
+
Measured September 3, 2026 on a MacBook Pro M2 Max with Node 25.2.1,
|
|
311
|
+
comparing the exact `v2.2.2` tag (`6be2251`) with `v2.2.3`. The table reports
|
|
312
|
+
warmed median time per call from seven 300 ms samples after a 250 ms warmup;
|
|
313
|
+
lower is better. Version 2.2.3 uses the production-minified bundle described
|
|
314
|
+
below.
|
|
315
|
+
|
|
316
|
+
| Scenario | v2.2.2 | v2.2.3 | Speedup |
|
|
317
|
+
| --- | ---: | ---: | ---: |
|
|
318
|
+
| SECONDLY next, COUNT 128, rank 63 | 9.53 us | 1.10 us | 8.66x |
|
|
319
|
+
| SECONDLY next, COUNT 250k, rank 200k | 9.53 us | 1.15 us | 8.29x |
|
|
320
|
+
| DAILY next, COUNT 9k, rank 8.5k, UTC | 10.36 us | 1.68 us | 6.17x |
|
|
321
|
+
| DAILY previous, COUNT 9k, rank 8.5k, Chicago | 13.08 us | 2.25 us | 5.81x |
|
|
322
|
+
| DAILY weekdays next, COUNT 9k, distant, UTC | 11.01 us | 1.93 us | 5.70x |
|
|
323
|
+
| DAILY slots narrow between, COUNT 9k, UTC | 34.82 us | 9.70 us | 3.59x |
|
|
324
|
+
| WEEKLY M/W/F slots next, COUNT 9k, UTC | 10.58 us | 1.78 us | 5.94x |
|
|
325
|
+
| MONTHLY last weekday next, COUNT 9k, UTC | 31.34 us | 22.88 us | 1.37x |
|
|
326
|
+
| MONTHLY last weekday next, COUNT 128, rank 63 | 21.32 us | 12.14 us | 1.76x |
|
|
327
|
+
| SECONDLY `occursOn()`, COUNT 100k | 254.4 ms | 7.84 us | 32,449x |
|
|
328
|
+
| DAILY RDATE/EXDATE next, COUNT 9k, rank 8.5k | 52.4 ms | 2.20 us | 23,818x |
|
|
329
|
+
| YEARLY BYMONTH/BYMONTHDAY next, COUNT 9k, rank 8.5k | 382.2 ms | 7.94 us | 48,136x |
|
|
330
|
+
| SECONDLY `all()`, COUNT 3.6k, explicit Temporal output | 41.4 ms | 19.6 ms | 2.11x |
|
|
331
|
+
|
|
332
|
+
The named-zone cold call still includes lazy transition-table construction;
|
|
333
|
+
the query harness prints cold timings and each sample's warm range.
|
|
326
334
|
|
|
327
335
|
### Full recurrence generation
|
|
328
336
|
|
|
329
|
-
Uncached median ops/s
|
|
330
|
-
|
|
331
|
-
after a 200 ms warmup. The
|
|
332
|
-
|
|
337
|
+
Uncached median ops/s from the same MacBook Pro M2 Max with Node 25.2.1 using
|
|
338
|
+
the polyfill backend and `rrule` 2.8.1. Each result is the median of five 200 ms
|
|
339
|
+
samples after a 200 ms warmup. The production bundle is minified, which
|
|
340
|
+
disables `temporal-polyfill`'s development-only per-instance debug strings. The
|
|
341
|
+
three-library comparison, query methodology, and cached-mode summary live in
|
|
342
|
+
[`benchmarks/README.md`](benchmarks/README.md).
|
|
333
343
|
|
|
334
344
|
| Scenario | TZ | rrule-temporal median ops/s | rrule median ops/s | vs rrule |
|
|
335
345
|
| --- | --- | ---: | ---: | ---: |
|
|
336
|
-
| 30 daily occurrences | UTC |
|
|
337
|
-
| 30 daily occurrences | America/Chicago |
|
|
338
|
-
| Daily weekdays across many cycles | UTC |
|
|
339
|
-
| Daily weekdays across many cycles | America/Chicago |
|
|
340
|
-
| Daily time-slot expansion | UTC |
|
|
341
|
-
| Daily time-slot expansion | America/Chicago |
|
|
342
|
-
| 720 hourly occurrences | UTC |
|
|
343
|
-
| 720 hourly occurrences | America/Chicago |
|
|
344
|
-
| 1,440 minutely occurrences | UTC |
|
|
345
|
-
| 1,440 minutely occurrences | America/Chicago |
|
|
346
|
-
| 3,600 secondly occurrences | UTC |
|
|
347
|
-
| 3,600 secondly occurrences | America/Chicago |
|
|
348
|
-
| Weekly MO/WE/FR across many cycles | UTC |
|
|
349
|
-
| Weekly MO/WE/FR across many cycles | America/Chicago |
|
|
350
|
-
| Weekly day and time-slot expansion | UTC |
|
|
351
|
-
| Weekly day and time-slot expansion | America/Chicago |
|
|
352
|
-
| Monthly last weekday across 20 years | UTC |
|
|
353
|
-
| Monthly last weekday across 20 years | America/Chicago |
|
|
354
|
-
| Monthly first and last weekday across 20 years | UTC |
|
|
355
|
-
| Monthly first and last weekday across 20 years | America/Chicago |
|
|
346
|
+
| 30 daily occurrences | UTC | 75,108 | 15,200 | 4.94x |
|
|
347
|
+
| 30 daily occurrences | America/Chicago | 32,314 | 342 | 94.49x |
|
|
348
|
+
| Daily weekdays across many cycles | UTC | 3,889 | 739 | 5.26x |
|
|
349
|
+
| Daily weekdays across many cycles | America/Chicago | 1,784 | 18.5 | 96.43x |
|
|
350
|
+
| Daily time-slot expansion | UTC | 2,159 | 1,152 | 1.87x |
|
|
351
|
+
| Daily time-slot expansion | America/Chicago | 949 | 11.0 | 86.27x |
|
|
352
|
+
| 720 hourly occurrences | UTC | 2,862 | 729 | 3.93x |
|
|
353
|
+
| 720 hourly occurrences | America/Chicago | 1,207 | 14.1 | 85.60x |
|
|
354
|
+
| 1,440 minutely occurrences | UTC | 1,351 | 337 | 4.01x |
|
|
355
|
+
| 1,440 minutely occurrences | America/Chicago | 639 | 6.0 | 106.50x |
|
|
356
|
+
| 3,600 secondly occurrences | UTC | 534 | 126 | 4.24x |
|
|
357
|
+
| 3,600 secondly occurrences | America/Chicago | 245 | 2.6 | 94.23x |
|
|
358
|
+
| Weekly MO/WE/FR across many cycles | UTC | 2,193 | 1,095 | 2.00x |
|
|
359
|
+
| Weekly MO/WE/FR across many cycles | America/Chicago | 979 | 14.6 | 67.05x |
|
|
360
|
+
| Weekly day and time-slot expansion | UTC | 1,698 | 1,201 | 1.41x |
|
|
361
|
+
| Weekly day and time-slot expansion | America/Chicago | 834 | 11.0 | 75.82x |
|
|
362
|
+
| Monthly last weekday across 20 years | UTC | 2,042 | 1,023 | 2.00x |
|
|
363
|
+
| Monthly last weekday across 20 years | America/Chicago | 1,549 | 36.7 | 42.21x |
|
|
364
|
+
| Monthly first and last weekday across 20 years | UTC | 1,499 | 1,179 | 1.27x |
|
|
365
|
+
| Monthly first and last weekday across 20 years | America/Chicago | 1,015 | 22.0 | 46.14x |
|
|
356
366
|
|
|
357
367
|
Time-zone-aware rules iterate through an epoch-integer engine with a cached
|
|
358
|
-
per-zone offset table, so named-zone scenarios
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
weekdays ~2,800 ops/s. Repeated `all()` calls on the same rule are served from
|
|
366
|
-
an internal cache (opt out per rule with `cache: false`).
|
|
368
|
+
per-zone offset table, so named-zone scenarios ran 42-107x faster than `rrule`
|
|
369
|
+
in this pass. Minifying the production bundle removes polyfill debug
|
|
370
|
+
instrumentation from occurrence materialization, making UTC generation
|
|
371
|
+
1.27-5.26x faster than `rrule` across every scenario. Earlier native-Temporal
|
|
372
|
+
measurements are retained in the detailed benchmark README but were not rerun
|
|
373
|
+
in this Node 25/polyfill pass. Repeated `all()` calls on the same rule instance
|
|
374
|
+
are served from an internal cache (opt out per rule with `cache: false`).
|
|
367
375
|
|
|
368
376
|
## Further examples
|
|
369
377
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_src = require("./src-B2AIB5jJ.cjs");
|
|
3
|
-
exports.RRuleTemporal = require_src.RRuleTemporal;
|
|
4
|
-
exports.allowedFreq = require_src.allowedFreq;
|
|
5
|
-
exports.allowedWeekdays = require_src.allowedWeekdays;
|
|
6
|
-
exports.weekdayToIsoDay = require_src.weekdayToIsoDay;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-DP31wO2R.cjs`);exports.RRuleTemporal=e.t,exports.allowedFreq=e.n,exports.allowedWeekdays=e.r,exports.weekdayToIsoDay=e.i;
|
package/dist/index.d.cts
CHANGED
|
@@ -126,7 +126,10 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
126
126
|
private readonly hasUniqueTimeSlotOffsets;
|
|
127
127
|
private readonly numericByMonths?;
|
|
128
128
|
private exDateEpochNs?;
|
|
129
|
+
private numericRDatesCache?;
|
|
129
130
|
private allResultCache?;
|
|
131
|
+
private publicAllResultCache?;
|
|
132
|
+
private outputConstructorFastPathAvailable?;
|
|
130
133
|
private zoneResolver?;
|
|
131
134
|
private emitAnchorZdt?;
|
|
132
135
|
private numericQueryPlanCache;
|
|
@@ -136,7 +139,6 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
136
139
|
* This prevents type mismatches when mixing native and polyfill Temporal objects.
|
|
137
140
|
*/
|
|
138
141
|
private static normalizeToPolyfill;
|
|
139
|
-
private toInternalIterator;
|
|
140
142
|
private toPublicDate;
|
|
141
143
|
private toPublicDates;
|
|
142
144
|
constructor(params: RRuleOptions<TOutput>);
|
|
@@ -222,6 +224,14 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
222
224
|
private buildDailyNumericQueryPlan;
|
|
223
225
|
private buildWeeklyNumericQueryPlan;
|
|
224
226
|
private buildMonthlyNumericQueryPlan;
|
|
227
|
+
/**
|
|
228
|
+
* Build one Gregorian recurrence year's wall-clock occurrences as as-if-UTC
|
|
229
|
+
* epoch milliseconds. This deliberately covers the common YEARLY shapes
|
|
230
|
+
* whose calendar membership repeats on the 400-year Gregorian cycle.
|
|
231
|
+
*/
|
|
232
|
+
private generateYearlyOccurrenceEpochsUtc;
|
|
233
|
+
private yearlyCandidateEvaluationCountUtc;
|
|
234
|
+
private buildYearlyNumericQueryPlan;
|
|
225
235
|
private buildNumericQueryPlan;
|
|
226
236
|
private getNumericQueryPlan;
|
|
227
237
|
private findFirstMatchingDailyStep;
|
|
@@ -304,6 +314,10 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
304
314
|
* @returns True if the date is excluded
|
|
305
315
|
*/
|
|
306
316
|
private isExcluded;
|
|
317
|
+
private isExcludedEpoch;
|
|
318
|
+
/** Sorted, de-duplicated, and EXDATE-filtered explicit recurrence dates. */
|
|
319
|
+
private getNumericRDates;
|
|
320
|
+
private numericRDateLowerBound;
|
|
307
321
|
/**
|
|
308
322
|
* Excludes exDate entries from the given array of dates.
|
|
309
323
|
* @param dates - Array of dates to filter
|
|
@@ -359,6 +373,7 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
359
373
|
* in the rule's time zone. This ignores time-of-day granularity.
|
|
360
374
|
*/
|
|
361
375
|
occursOn(date: TemporalPlainDateInput): boolean;
|
|
376
|
+
private nextInternal;
|
|
362
377
|
/**
|
|
363
378
|
* Returns the next occurrence of the rule after a specified date.
|
|
364
379
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
package/dist/index.d.ts
CHANGED
|
@@ -126,7 +126,10 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
126
126
|
private readonly hasUniqueTimeSlotOffsets;
|
|
127
127
|
private readonly numericByMonths?;
|
|
128
128
|
private exDateEpochNs?;
|
|
129
|
+
private numericRDatesCache?;
|
|
129
130
|
private allResultCache?;
|
|
131
|
+
private publicAllResultCache?;
|
|
132
|
+
private outputConstructorFastPathAvailable?;
|
|
130
133
|
private zoneResolver?;
|
|
131
134
|
private emitAnchorZdt?;
|
|
132
135
|
private numericQueryPlanCache;
|
|
@@ -136,7 +139,6 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
136
139
|
* This prevents type mismatches when mixing native and polyfill Temporal objects.
|
|
137
140
|
*/
|
|
138
141
|
private static normalizeToPolyfill;
|
|
139
|
-
private toInternalIterator;
|
|
140
142
|
private toPublicDate;
|
|
141
143
|
private toPublicDates;
|
|
142
144
|
constructor(params: RRuleOptions<TOutput>);
|
|
@@ -222,6 +224,14 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
222
224
|
private buildDailyNumericQueryPlan;
|
|
223
225
|
private buildWeeklyNumericQueryPlan;
|
|
224
226
|
private buildMonthlyNumericQueryPlan;
|
|
227
|
+
/**
|
|
228
|
+
* Build one Gregorian recurrence year's wall-clock occurrences as as-if-UTC
|
|
229
|
+
* epoch milliseconds. This deliberately covers the common YEARLY shapes
|
|
230
|
+
* whose calendar membership repeats on the 400-year Gregorian cycle.
|
|
231
|
+
*/
|
|
232
|
+
private generateYearlyOccurrenceEpochsUtc;
|
|
233
|
+
private yearlyCandidateEvaluationCountUtc;
|
|
234
|
+
private buildYearlyNumericQueryPlan;
|
|
225
235
|
private buildNumericQueryPlan;
|
|
226
236
|
private getNumericQueryPlan;
|
|
227
237
|
private findFirstMatchingDailyStep;
|
|
@@ -304,6 +314,10 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
304
314
|
* @returns True if the date is excluded
|
|
305
315
|
*/
|
|
306
316
|
private isExcluded;
|
|
317
|
+
private isExcludedEpoch;
|
|
318
|
+
/** Sorted, de-duplicated, and EXDATE-filtered explicit recurrence dates. */
|
|
319
|
+
private getNumericRDates;
|
|
320
|
+
private numericRDateLowerBound;
|
|
307
321
|
/**
|
|
308
322
|
* Excludes exDate entries from the given array of dates.
|
|
309
323
|
* @param dates - Array of dates to filter
|
|
@@ -359,6 +373,7 @@ declare class RRuleTemporal<TOutput extends TemporalZonedDateTimeInput = Tempora
|
|
|
359
373
|
* in the rule's time zone. This ignores time-of-day granularity.
|
|
360
374
|
*/
|
|
361
375
|
occursOn(date: TemporalPlainDateInput): boolean;
|
|
376
|
+
private nextInternal;
|
|
362
377
|
/**
|
|
363
378
|
* Returns the next occurrence of the rule after a specified date.
|
|
364
379
|
* @param after - The start date or Temporal.ZonedDateTime object.
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { RRuleTemporal, allowedFreq, allowedWeekdays, weekdayToIsoDay };
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./src-CNIROjgI.js";export{r as RRuleTemporal,t as allowedFreq,n as allowedWeekdays,e as weekdayToIsoDay};
|