Legend:
Library
Module
Module type
Parameter
Class
Class type
A version of collate with caching.
We use Incr_memoize to cache incremental nodes for the result of a particular:
order,
(order, filter), and
(order, filter, range_bucket)
so that even if the Collate.t Incr.t changes, as long as it changes back before the result is evicted from the cache, we can resume a cached incremental computation instead of discarding it and computing it from scratch.
Note that if an earlier incremental node is evicted from its cache, its children in subsequent caches are no longer used. This is to ensure we don't duplicate computations from building later nodes on top of semantically identical but physically distinct earlier nodes.
For example, if the order cache is LRU with size 2, and order_filter_range is LRU with size 10, you could get 10 cached final values if they only use two distinct orderings, but if they were to each have a distinct ordering, only two will be usable.