Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Performance Issue with large API specs #56

Open
nkuehn opened this issue Nov 12, 2019 · 8 comments
Open

Performance Issue with large API specs #56

nkuehn opened this issue Nov 12, 2019 · 8 comments
Labels
amf Related to AMF issue, bug or specific behavior performance

Comments

@nkuehn
Copy link

nkuehn commented Nov 12, 2019

Hi,
we're stuck parsing, validating and resolving the full API surface of our system using this new parser (running it via the JS output).

Our API spec is public here: https://github.com/commercetools/commercetools-api-reference

The main entry file is api.raml

One problem is a recursion in the Categories API, but the performance problem remains even after commenting that recursion out in types/category/CategoryReference.raml

Feel free to use that huge API as a smoketest but keep in mind it's not OSS licensed (unlicensed) so you can't redistribute, modify or use the domain IP otherwise).

Any idea what could be the issue?

PS: we're currently working on it using our own parser / validator implementation which can handle it:
https://github.com/vrapio/rest-modeling-framework

@postatum
Copy link
Contributor

Hi @nkuehn.

What kind of performance issue do you have - memory, execution time?
Did you use a different parser before?

@nkuehn
Copy link
Author

nkuehn commented Nov 12, 2019

It's running at 70% CPU on one core (typical node.js situation). It's parsing and validating but I have the impression that resolving is stuck.

We do use our own EMF based parser for all our code generation and other needs, see the link in the P.S.. We did try with the previous RAML JS parser, too which had issues with the recursive situation but was able to load the spec at all after commenting out the recursive situation (slowly, but not getting completely stuck).

@postatum
Copy link
Contributor

@nkuehn I see. I'm unable to resolve the doc you provided as well. I've reported this issues to our dependency lib. Please see the issue referenced above.

@nkuehn
Copy link
Author

nkuehn commented Nov 14, 2019

thank you so much!

@postatum postatum added the amf Related to AMF issue, bug or specific behavior label Jan 31, 2020
@postatum
Copy link
Contributor

Hi @nkuehn.

According to the answer I got (aml-org/amf#567 (comment)), our dependency lib performance has increased dramatically since the time this issue was reported.

We are currently working on updating our dependencies to the latest version. I'll let you know when the new version is available so you could test again.

@nkuehn
Copy link
Author

nkuehn commented Jun 19, 2020

Thanks for the update @postatum ! We've switched to our own parser implementation in the meanwhile because we use it intensively for code generation too and have the knowledge in house. Nevertheless I'm tracking progress here, the topic will remain relevant.

@postatum
Copy link
Contributor

Thanks for the update @postatum ! We've switched to our own parser implementation in the meanwhile because we use it intensively for code generation too and have the knowledge in house. Nevertheless I'm tracking progress here, the topic will remain relevant.

I see. Is your parser open-sourced?

@nkuehn
Copy link
Author

nkuehn commented Jun 22, 2020

Yes, it's not as productized or marketed though.

It's JVM-based, so usage in javascript projects is not as convenient but by building on EMF we don't have to spend a lot of time in the low-level nitty gritty of metamodeling etc. (I'm not personally the maintainer, just one of the internal users)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
amf Related to AMF issue, bug or specific behavior performance
Projects
None yet
Development

No branches or pull requests

2 participants