metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.44k stars 205 forks source link

Enable (leaf-)Schema caching #870

Open ikitommi opened 1 year ago

ikitommi commented 1 year ago

Leaf-schemas are usually created without properties or children. This MR introduces IntoSchema level caching. Schema instance cache is enabled if all of the following apply:

Currently, this is enabled just for m/-simple-schemas, yielding 15% better performance on schema creation + smaller memory footprint (not tested)

ikitommi commented 1 year ago

marked as invalid as not sure if this makes sense. More code, small benefits.