recurr
recurr copied to clipboard
Refactor entire library to improve performance
I feel like there is probably a more efficient way to calculate recurrences than how the library currently does it.
The goal of this issue is to figure out how performance can be improved (and clean up the codebase in the process).
- [ ] Figure out if there's a more efficient way to calculate recurrences than looping through each day.
- [ ] Adding to the previous item, try to avoid generating so many \DateTime objects.
I don't know whats your PHP target version here, but the Transformer could benefit from generators (http://php.net/manual/en/language.generators.overview.php). It seems very memory intensive to create the complete array at once.
I began work on a rewrite back in August that uses an iterator. Similar concept - each recurrence is calculated on demand instead of all at once.