raml-js-parser-2
raml-js-parser-2 copied to clipboard
Very slow performance of parseRAMLSync and toJSON methods
Parsing the given RAML data using the following lines both methods takes around 30 seconds each.
const parsedData = parser.parseRAMLSync(data, RAMLImporter._options(options)); //30 seconds
if (parsedData.name === 'Error') {
reject(error);
} else {
this.data = parsedData.expand(true).toJSON(toJSONOptions); //30 seconds
resolve();
}
File has more than 19000 lines.
Please check the new API https://github.com/raml-org/raml-js-parser-2/blob/master/documentation/GettingStartedNewApi.md and let us know if it helps, this one should be faster.
Note that we can not speed the parser up like 10 times.
Hi @ddenisenko , I don't know what are the method of the new API for parseRAML. (old API) => (new API) loadApi => load loadApiSync => loadSync parseRAML => ??? parseRAMLSync => ???
Thanks.
Note that raml-js-parser-2 has been deprecated, the new official parser is webapi-parser. Feel free to attempt to reproduce this issue with webapi-parser and report any issue you may have on that repository.