malli icon indicating copy to clipboard operation
malli copied to clipboard

Add schema simplification / worker optimization

Open bsless opened this issue 2 years ago • 1 comments

Schemas that contain choice need to backtrack when validation or coercion fail. As schemas get larger and more complicated, this can result in redundant work.

Proposed solution, using boolean algebra notation:

( A B ) + (A C) -> A (B +C)

This can be done trivially for validation, and with some care for transformation as well.

Users might want to trade off compile time for run time, so it should be configurable.

Also see: https://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algorithm

bsless avatar Jan 12 '23 19:01 bsless

See also: https://github.com/miikka/boolean-simplifier

opqdonut avatar Mar 07 '23 12:03 opqdonut