Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Very slow performance of parseRAMLSync and toJSON methods #652

Open
glodieu opened this issue Feb 17, 2017 · 5 comments
Open

Very slow performance of parseRAMLSync and toJSON methods #652

glodieu opened this issue Feb 17, 2017 · 5 comments

Comments

@glodieu
Copy link

glodieu commented Feb 17, 2017

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();
}
@glodieu
Copy link
Author

glodieu commented Feb 17, 2017

652.txt

@glodieu
Copy link
Author

glodieu commented Feb 17, 2017

File has more than 19000 lines.

@ddenisenko
Copy link
Contributor

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.

@glodieu
Copy link
Author

glodieu commented Oct 10, 2017

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.

@postatum
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants