Coder Social home page Coder Social logo

Comments (4)

stevehu avatar stevehu commented on May 23, 2024 2

@xaviarias I got it. It should be cached. I will get it fixed once I have time and pull request is welcome.

from json-schema-validator.

stevehu avatar stevehu commented on May 23, 2024

If you understand your questions correctly, you want to confirm if these ref schemas are cached in memory during processing, then the answer is yes. All the schemas are loaded before hand and cached in memory so that we can have fast validation. We have a benchmark to compare with other popular Java implementations.
https://github.com/networknt/json-schema-validator-perftest

from json-schema-validator.

xaviarias avatar xaviarias commented on May 23, 2024

Hi Steve!

My question was more regarding remote schemas. Every time RefValidator is fetching a schema, JsonSchemaFactory opens a new stream:

https://github.com/networknt/json-schema-validator/blob/0.1.6/src/main/java/com/networknt/schema/RefValidator.java#L59

Could we think in implementing a mechanism, for instance at the JsonSchemaFactory level, to avoid this overload? (E.g. a cache from URL -> JsonSchema)

from json-schema-validator.

stevehu avatar stevehu commented on May 23, 2024

@xaviarias I looked into the code and found out the access to remote is only in the constructor of RefValidator. In this case, it should only be called once during initialization. It is cached in that way like other validators. Could you please test it out to verify it? Thanks.

from json-schema-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.