Closed Eli-Black-Work closed 3 years ago
I have similar issues with a 4MB json schema file (FHIR).
any updates for this defect ? I'm also facing it
I encounter this performance problem in case of non direct circular reference
In this simple case, I enter 680 times in the dereference$Ref function
"interface-.ts-69348-69886-.ts-0-209362": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"slice": {
"type": "function",
"arguments": {
"begin": {
"type": "number"
},
"end": {
"type": "number"
}
},
"return": {
"$ref": "#/definitions/interface-.ts-69348-69886-.ts-0-209362"
},
"required": [
"begin"
]
}
},
"required": [
"byteLength",
"slice"
],
"additionalProperties": false
},
Can you take a look at this problem ? this is really annoying
Sorry bad example, I didn't pass so much time inside this one. Try to find a better example
found a fix It's available in my PR: https://github.com/APIDevTools/json-schema-ref-parser/pull/195 Now performances are really good
First of all, thanks for writing this library :)
We're running into a performance issue that I wanted to alert you to.
We're loading a fairly large (~900KB) JSON schema file, parsing it, and running the resulting JavaScript object through this library's
dereference()
function. Thedereference()
call takes around 68 seconds to complete.We've disabled all loading of local or external files, so I don't think that any of the time spent in
dereference()
is due to loading external resources.Here's basically what the code looks like:
The schema does contain circular references.