Skip to content

Releases: typst/comemo

Version 0.5.1

Choose a tag to compare

@laurmaedje laurmaedje released this 29 Jan 10:59

This patch release fixes an unnecessarily restrictive bound on Constraint::validate.

Version 0.5.0

Choose a tag to compare

@laurmaedje laurmaedje released this 31 Jul 08:30
  • 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 public Constraint 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

Choose a tag to compare

@laurmaedje laurmaedje released this 07 Mar 09:38
  • Comemo now uses a global cache instead of thread-local one. As a result, return values of memoized functions and inputs to tracked functions must now be Send and Sync. (Thanks to @Dherse)
  • The internal data structures have also been optimized to speed comemo up (Thanks to @Dherse)

Version 0.3.1

Choose a tag to compare

@laurmaedje laurmaedje released this 27 Nov 15:35
  • 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

0.3.0 Pre-release
Pre-release

Choose a tag to compare

@laurmaedje laurmaedje released this 16 May 14:36

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 from Track to the new Validate trait

0.2.2

0.2.2 Pre-release
Pre-release

Choose a tag to compare

@laurmaedje laurmaedje released this 17 Apr 17:46

This release switches from SipHash 2-4 to SipHash 1-3 for better performance. Thanks to @dccsillag!

0.2.1

0.2.1 Pre-release
Pre-release

Choose a tag to compare

@laurmaedje laurmaedje released this 13 Apr 12:21

This release adds a new update method to Prehashed.

0.2

0.2 Pre-release
Pre-release

Choose a tag to compare

@laurmaedje laurmaedje released this 27 Mar 08:46

This release features mutation tracking and exposes contraints for more advanced use cases.

0.1

0.1 Pre-release
Pre-release

Choose a tag to compare

@laurmaedje laurmaedje released this 15 Oct 14:12

This is the initial release of comemo, an incremental computation library.