Git Product home page Git Product logo

Comments (3)

gregsdennis avatar gregsdennis commented on June 1, 2024

Create new options everytime to call _constraints.Clear()

I would recommend against creating new options for each evaluation. I understand that this is for replicating in the test, but what's the real-world usage?

The recommendation is to have a single options object that is re-used.

from json-everything.

filzrev avatar filzrev commented on June 1, 2024

The recommendation is to have a single options object that is re-used.

Yes. This problems can be resolved by changing existing code,
to reuse shared object that is defined as static readonly field.

but what's the real-world usage?

On my use case.
The above solution is sufficient to resolve existing code problems.

from json-everything.

filzrev avatar filzrev commented on June 1, 2024

I understand that this behavior is by design.

But it seems unclear from API user.
That It cause constraints re-build every time when passing new EvaluationOptions.

There are some existing code found that using cached JsonSchema object. But passing new option instance everytime.
https://github.com/search?q=%22EvaluationOptions%22+%22schema.Evaluate%22+language%3AC%23&type=code

I thought it's better to add parameter doc comments. (And 6.0.3 release notes)
Some thing like.

> This parameter is expected that same `EvaluationOptions` reference is passed.
> If a different `EvaluationOptions` instance is passed. 
> It must rebuild the constraints. And this operation isn't non-thread safe.
> When using cached schema object. It's recommended to use single `EvaluationOptions`. 

from json-everything.

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.