plumatic / schema

Clojure(Script) library for declarative data description and validation
Other
2.4k stars 256 forks source link

Optimize CollectionSpec checker #436

Open nilern opened 2 years ago

nilern commented 2 years ago

The latter could improve #356 substantially; in the Malli seqex impl I had a similar situation with a persistent set in an atom on cljs and it was just unacceptably slow.

w01fe commented 2 years ago

Thanks for the PR! Certainly happy to accept optimizations but always prefer if they come with measurements. And would like to learn more about the choice of reduce over doseq.

nilern commented 2 years ago

I want to do some benchmarks but for now I am out of time.

w01fe commented 2 years ago

Thanks! I just want to make sure we are striking the right balance between performance and clarity, i.e. only making optimizations that make a measurable difference. My intuition is admittedly stale here, so I'm happy to take these with measurements, or happy if another maintainer wants to take them without.

nilern commented 2 years ago

I don't think this adds much complexity; it is just using JS arrays just like it was already using ArrayList on the JVM.

While I am fairly confident it will also be faster it would be silly to optimize without benchmarking.