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 CHANGED
@@ -305,65 +305,73 @@ Notes
305
305
 
306
306
  ## Benchmarks
307
307
 
308
- COUNT-bound query results from a MacBook Pro M2 Max / Node 25 run, comparing
309
- `v2.0.3` with the `v2.1.0` candidate. Times are milliseconds per call; both
310
- builds used the same harness and result checksum.
311
-
312
- | Scenario | v2.0.3 first | v2.1.0 first | First speedup | v2.0.3 warm | v2.1.0 warm | Warm speedup |
313
- | --- | ---: | ---: | ---: | ---: | ---: | ---: |
314
- | SECONDLY next, COUNT 128, rank 63 | 3.10 | 0.584 | 5.3x | 0.242 | 0.00951 | 25.5x |
315
- | SECONDLY next, COUNT 250k, rank 200k | 886.0 | 0.137 | 6,481x | 806.3 | 0.00950 | 84,874x |
316
- | DAILY next, COUNT 9k, rank 8.5k, UTC | 50.6 | 0.291 | 174x | 47.6 | 0.00984 | 4,837x |
317
- | DAILY previous, COUNT 9k, rank 8.5k, Chicago | 60.2 | 7.59 | 7.9x | 53.4 | 0.01250 | 4,272x |
318
- | DAILY weekdays next, COUNT 9k, distant, UTC | 68.7 | 0.0895 | 768x | 61.4 | 0.01010 | 6,079x |
319
- | DAILY slots narrow between, COUNT 9k, UTC | 32.6 | 0.326 | 100x | 30.4 | 0.03466 | 877x |
320
- | WEEKLY M/W/F slots next, COUNT 9k, UTC | 122.5 | 0.353 | 347x | 81.8 | 0.01037 | 7,888x |
321
- | MONTHLY last weekday next, COUNT 9k, UTC | 197.8 | 8.54 | 23.2x | 186.3 | 0.03191 | 5,838x |
322
- | MONTHLY last weekday next, COUNT 128, rank 63 | 1.49 | 0.321 | 4.6x | 1.40 | 0.02155 | 65.0x |
323
-
324
- The named-zone first call includes lazy transition-table construction. Its
325
- warmed path reuses both that table and the immutable rule's numeric query plan.
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 for `rrule-temporal` v2.1.0 on a MacBook Pro M2 Max
330
- (Node 25, polyfill backend). Each result is the median of five 200 ms samples
331
- after a 200 ms warmup. The three-library comparison, query methodology, and
332
- cached-mode summary live in [`benchmarks/README.md`](benchmarks/README.md).
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 | 18,847 | 14,581 | 1.29x |
337
- | 30 daily occurrences | America/Chicago | 12,796 | 328 | 39.01x |
338
- | Daily weekdays across many cycles | UTC | 961 | 713 | 1.35x |
339
- | Daily weekdays across many cycles | America/Chicago | 723 | 18.4 | 39.29x |
340
- | Daily time-slot expansion | UTC | 488 | 1,006 | 0.49x |
341
- | Daily time-slot expansion | America/Chicago | 371 | 10.7 | 34.67x |
342
- | 720 hourly occurrences | UTC | 685 | 723 | 0.95x |
343
- | 720 hourly occurrences | America/Chicago | 491 | 13.2 | 37.20x |
344
- | 1,440 minutely occurrences | UTC | 326 | 332 | 0.98x |
345
- | 1,440 minutely occurrences | America/Chicago | 245 | 6.8 | 36.03x |
346
- | 3,600 secondly occurrences | UTC | 121 | 130 | 0.93x |
347
- | 3,600 secondly occurrences | America/Chicago | 101 | 2.8 | 36.07x |
348
- | Weekly MO/WE/FR across many cycles | UTC | 538 | 1,126 | 0.48x |
349
- | Weekly MO/WE/FR across many cycles | America/Chicago | 418 | 13.8 | 30.29x |
350
- | Weekly day and time-slot expansion | UTC | 426 | 1,197 | 0.36x |
351
- | Weekly day and time-slot expansion | America/Chicago | 343 | 11.7 | 29.32x |
352
- | Monthly last weekday across 20 years | UTC | 1,114 | 1,146 | 0.97x |
353
- | Monthly last weekday across 20 years | America/Chicago | 921 | 43.5 | 21.17x |
354
- | Monthly first and last weekday across 20 years | UTC | 664 | 1,287 | 0.52x |
355
- | Monthly first and last weekday across 20 years | America/Chicago | 553 | 23.4 | 23.63x |
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 now run 21–39x faster than
359
- `rrule` and within a small factor of their UTC equivalents. On UTC the two
360
- libraries are comparable on Node 25 (`rrule` stays ahead in several expanded
361
- and weekly/monthly scenarios where occurrence materialization dominates); on
362
- runtimes with native Temporal (Node 26+, Chrome 144+, Firefox 139+)
363
- materialization is much cheaper, and `rrule-temporal` led every measured core
364
- scenario — e.g. monthly last weekday in Chicago reaches ~2,200 ops/s and daily
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, Symbol.toStringTag, { value: "Module" });
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 { i as weekdayToIsoDay, n as allowedFreq, r as allowedWeekdays, t as RRuleTemporal } from "./src-B2XO5sNr.js";
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};