Generic JSON input #239
Labels
Difficulty: Medium
help wanted
Extra attention is needed
Priority: High
Topic: Performance
Type: Enhancement
At the moment,
jsonschema
supports onlyserde_json
, which is convenient, but implies significant overhead in some cases. For example, in Python bindings, I got to convert Python structures toserde_json::Value
first and this conversion takes up to 85% of the overall validation time. It will be much faster if those Python objects will be used directly without conversion.It could be done with a generic
Json
trait that will implement some API on the input data (likely similar toserde_json
). In this case, implementingJson
on a newtype wrapper aroundPyAny
will eliminate the need for conversion. Additionally, it will reduce the memory footprint as no copying will be needed.For existing
serde_json
data it should be optimized away as the wrapper will just delegate the calls toserde_json::Value
.The text was updated successfully, but these errors were encountered: