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

Performance improvements #603

Open
hwellmann opened this issue Mar 27, 2019 · 0 comments
Open

Performance improvements #603

hwellmann opened this issue Mar 27, 2019 · 0 comments

Comments

@hwellmann
Copy link

hwellmann commented Mar 27, 2019

raml-parser-2 is rather slow.

Generating Java code from a RAML 1.0 spec of ~6700 lines with Ramler, which is based on this parser, takes about 7500 ms.

I tried to identify the bottlenecks using the jvisualvm sampler, and I found the following hotspots:

  • calls of Class.forName() in PackageModelBinding
  • calls of Class.getMethod() in ModelProxyBuilder.SimpleProxy.findMatchingMethod()
  • ArrayList creation in BaseNode.findDescendantsWith()
  • repeated calls of BaseNode.findDescendantsWith() with the same argument

After optimizing these hotspots in a local build, my code generator only takes 1500 ms for the same input.

I'll submit a pull request with my changes.

Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-42

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

No branches or pull requests

1 participant