mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
Currently, navigating through different years in the Year view of the Calendar app or the taskbar is very slow. Profiling results show that almost all the time is spent in `Calendar::update_tiles`, and specifically, in `DateTime::create` and `DateTime::set_time`. Performance can improve substantially if the `TZ` environment variable is set [0], but we can improve the current code to perform better nevertheless :^) This diff focuses on removing the need of the `Tile` struct to require the instantiation of a `DateTime` object, which avoids _at least_ 365 object instantiations in the Year view, on each `update_tiles` call. Instead, as the `date_time` isn't used often, we can instantiate it on demand when a particular date is selected. [0] https://blog.packagecloud.io/set-environment-variable-save-thousands-of-system-calls/
29 KiB
29 KiB