raml-parser-2 is rather slow. Generating Java code from a RAML 1.0 spec of ~6700 lines with [Ramler](https://github.com/ops4j/org.ops4j.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
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:
Class.forName()inPackageModelBindingClass.getMethod()inModelProxyBuilder.SimpleProxy.findMatchingMethod()ArrayListcreation inBaseNode.findDescendantsWith()BaseNode.findDescendantsWith()with the same argumentAfter 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