Files
Kristjan ESPERANTO ef2c7dbb55 perf(calendar): pre-filter ICS data before parsing (#4168)
This adds a pre-filter that drops out-of-window non-recurring events
from the raw ICS data before `node-ical` parses it. Recurring events and
anything we cannot classify cheaply are kept - the existing logic
handles those as before.

Some calendars accumulate years of old events. Pre-filtering them
reduces the amount of work `node-ical` has to do and keeps event loop
lag lower. My benchmarks on a fast machine showed a small but measurable
speedup (roughly 10-20% with generated test data); on a Raspberry Pi it
should be significantly more noticeable.

For the implementation I ended up using
[`ics-filter`](https://github.com/runely/ics-filter), suggested by
@rejas. I had a custom version first, but ICS date string parsing has
enough complexity that it makes sense to delegate it to a package built
specifically for this. I also contributed a couple of fixes to
`ics-filter` along the way, and the maintainer was responsive and open
to improvements, so it seems like a good fit.

Solves #4103.
2026-06-15 21:58:14 +02:00
..

Module: Calendar

The calendar module is one of the default modules of the MagicMirror². This module displays events from a public .ical calendar. It can combine multiple calendars.

For configuration options, please check the MagicMirror² documentation.