yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator
MIT License
626 stars 146 forks source link

SwagGen memory consumption / performance #181

Open rpassis opened 5 years ago

rpassis commented 5 years ago

Hi @yonaskolb

Hope all is well with you!

I'm having a play with swaggen but struggling with it taking a long time running with no output, and consuming a lot of resources.

Am I doing something wrong or is there something I can do to?

swaggen generate api.yaml --destination generated --option name:Models
Loading spec from file:///api.yaml
Loaded spec: "XXXX API" - 602 operations, 76 definitions, 2 security definitions
Loaded template: 18 template files, 15 options

The process has been running for ~30mins so far and not much has happened (I see no files written to disk at least).

Also memory consumption is at 71gb and climbing, CPU maxed out with the swaggen process.

Screen Shot 2019-07-16 at 10 02 25 AM

Also here's a sample extract of the running process:

Sample of swaggen.txt

yonaskolb commented 5 years ago

Hmmm, there may be some sort of circular reference or something? A schema that references another schema that references the first one. That’s just a guess though

rpassis commented 5 years ago

I'll try find some time to debug this, thanks Yonas!