Performance issue
See original GitHub issueIssue Description
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. The dereference()
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:
const rawSchema = fetch(...);
const schema = JSON.parse(rawSchema);
if (typeof (schema) !== 'object')
throw `The schema was not an object.`;
const options = {
parse: {
json: false,
yaml: false,
text: false,
binary: false
},
resolve: {
external: false,
file: false,
http: false
},
continueOnError: false,
dereference: {
circular: true
}
};
console.log(performance.now());
$SchemaRefParser
.dereference(schema, options)
.then(dereferencedSchema => {
console.log(performance.now());
});
The schema does contain circular references.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Handling Performance Issues With Grace | Monster.com
Low Productivity or Late Completion – Make sure you've been clear about the requirements and expectations of the job. · Poor Quality of...
Read more >9 Examples of a Performance Issue - Simplicable Guide
A performance issue is a failure to meet the basic requirements of a job. They are based on reasonable expectations of behavior and...
Read more >Dealing with Performance Problems
Types of Performance Problems ; Quantity of work (untimely completion, limited production). Poor prioritizing, timing, scheduling; Lost time ; Quality of work ( ......
Read more >Top 5 Common Performance Problems - HRCI
Top 5 Common Performance Problems · Shallow Work · Inability to Prioritize · False Sense of Urgency · Productive Procrastination · Low-Quality Output....
Read more >5 Common Reasons for Performance Issues (Plus 3 Tips to ...
Most Common Causes of Performance Issues · 1. They lack knowledge or skill. · 2. They have unclear or unrealistic expectations. · 3....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
found a fix It’s available in my PR: https://github.com/APIDevTools/json-schema-ref-parser/pull/195 Now performances are really good
Sorry bad example, I didn’t pass so much time inside this one. Try to find a better example