Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After the optimizations I applied to generating modifiers in #1659, I noticed that about 50% of the time in componentWillReceiveProps is spent in isDayVisible() doing moment operations to generate the boundaries for the check. Since these boundaries remain very stable across each call, we can reduce most of the work done here to very little by adding some caching of these values. On top of my reduce optimizations, this brings down the time spent in componentWillReceiveProps to ~15ms. I'm not doing anything to limit the size of these Maps, so this will leak some memory, but I think the size of the cache will be really small in most cases, so I'm not sure it matters.
- Loading branch information