@tekacs not 100% sure about your use case, what about using transformers?
does the new -simple-schema
solve this?
I recently tested the end-to-end performance of JSON and realized we could plug malli into the jsonista pipeline: define a malli schema, create a jsonista functional-decoder out of it which picks just the defined keys from the JSON stream and runs (already optimized) value transformation for it. As there are no intermediate conversions, it should be MUCH faster.
• old-style json: stream --json-decode--> edn --schema-decode--> domain-data --json-encode--> string --ring-adapter--> bytes
• malli+jsonista: stream --json-and-schema-decode--> domain-data --json-and-schema-encode--> bytes
@ikitommi That's exactly an issue that I posted a couple of years ago in the compojure-api channel :) Awesome that this will now be supported via malli!
This is typically what you do in typed languages: write (de)serialization code which results in very efficient JSON processing. But in Clojure we typically just parse the entire blob
If you have a working example of this, I'd be very interested
since jsonista is also based on jackson-core I might be able to switch/add from cheshire to jsonista without adding very much binary size. if we then also add malli and reitit and http-kit server ... in babashka I mean. small web-apps :)
that would be great! Would like to get vertx working with clj + graalvm at some point. After that, one could write a code that can run really fast with jvm, with low resources with graalvm and with bb for scripting.
reitit+jsonista+porsas+pohjavirta is still one of the fastest jvm stacks in techempower db-query tests. It's a silly benchmark, but, still.
don't have an example of the json+malli, just know it's possible. Will do.