Releases: typst/comemo
Releases · typst/comemo
Version 0.5.0
- Implemented new constraint checking mechanism that speeds up validation of cache hits and avoids quadratic running time in pathological cases
- (Breaking change) The new design requires memoized functions to adhere to a new definition of determinism that we call reorderably deterministic. It is explained in the docs of the
#[memoize]
attribute. In practice, it's typically fulfilled by deterministic functions. If it's not fulfilled, comemo will panic in debug mode. Meanwhile, in release mode, memoized functions will still yield correct results, but caching may prove ineffective. - (Breaking change) Dropped support for mutable methods with return values and mixes of mutable and immutable methods in tracked blocks. Supporting this in the new constraint checker was deemed not worth it at this time.
- (Breaking change) The
Validate
trait was removed. The new design for manual constraint handling and validation is centered around the newly publicConstraint
type. Note that manual constraint handling is not relevant for average usage, but it's useful in rare case, for example in Typst's introspection system to detect layout convergence. - Added
enabled
parameter to#[memoize]
attribute for selectively disabling memoization based on the concrete input - Added enabled-by-default
macros
feature that guards the attribute macros - MSRV bumped to Rust 1.88, crates upgraded to 2024 edition
- Improved performance by using a faster hashing function in internal data structures
- Dropped dependency on
once_cell
Version 0.4.0
Version 0.3.1
- The traversal of cache entries for a specific hash is now in reverse to check the most recent entry first (temporal locality)
- Bumped syn to 2.0 and siphasher to 1.0
0.3.0
Improvements:
- Relaxes the
'static
bound on tracked types, they can now have lifetimes - Improves performance of constraint generation and validation
- Fixes possible name clashes in tracked methods (e.g. if parameters are called
value
)
Breaking changes:
- Removed public
Constraint
type, use<T as Validate>::Constraint
instead - Moved
valid
method fromTrack
to the newValidate
trait
0.2.2
This release switches from SipHash 2-4 to SipHash 1-3 for better performance. Thanks to @dccsillag!
0.2.1
This release adds a new update
method to Prehashed
.
0.2
This release features mutation tracking and exposes contraints for more advanced use cases.
0.1
This is the initial release of comemo
, an incremental computation library.