autorest.csharp: Autorest csharp seems to be A LOT slower upon recent upgrade

A bit of a woolly query, but we have noticed a drastic speed change over the past couple of days with the autorest part of our build pipeline. Historically it used to take under a minute to complete but now it is taking more than a couple of minutes to complete and in some cases it can hang for > 10 mins.

I am struggling to narrow down what the problem is, but here is the version details we had previously which were pretty quick and had no problems.

 .\node_modules\.bin\autorest --info
AutoRest code generation utility [version: 2.0.4166]

(C) 2017 Microsoft Corporation.
https://aka.ms/autorest
Showing All Installed Extensions

 Type       Extension Name                     Version   location
 core       @microsoft.azure/autorest-core     2.0.4275  C:\...\.autorest\@microsoft.azure_autorest-core@2.0.4275
 extension  @microsoft.azure/autorest.csharp   2.2.57    C:\...\.autorest\@microsoft.azure_autorest.csharp@2.2.57
 extension  @microsoft.azure/autorest.modeler  2.3.43    C:\...\.autorest\@microsoft.azure_autorest.modeler@2.3.43
 
Took 15s on local dev build (about 30% slower on CI)

Here is the version we are running now which seems a lot slower.

.\node_modules\.bin\autorest --info
AutoRest code generation utility [version: 2.0.4283; node: v8.9.3]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest


Showing All Installed Extensions

 Type       Extension Name                           Version      Location
 core       @microsoft.azure/autorest-core           2.0.4283     C:\...\.autorest\@microsoft.azure_autorest-core@2.0.4283
 extension  @microsoft.azure/autorest.csharp         2.3.80       C:\...\.autorest\@microsoft.azure_autorest.csharp@2.3.80
 extension  @microsoft.azure/autorest.modeler        2.3.55       C:\...\.autorest\@microsoft.azure_autorest.modeler@2.3.55
 
 Took 25s in our build (about 200% slower on CI build)

I noticed that there is some mention of some oldStringModel on the csharp generator but struggling to find much info on it, so can anyone point me in the direction as to what has changed which would cause the slowdown.

Here is what we run:

"node_modules/.bin/autorest" --csharp --input-file="http://localhost:5000/swagger/docs/v1" --namespace="SomeNamespace" --output-folder="SomeOutputFolder"

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 24 (10 by maintainers)

Most upvoted comments

I’ll have to go dig into what could be going on… grrr

Same issue here. when using '@microsoft.azure/autorest.csharp' (~2.2.51), it runs in <1min. when upgrading to @latest it uses '@microsoft.azure/autorest.csharp' (~2.3.79->2.3.80) and just consumes more and more memory and doesn’t ever stop (at least I wasn’t patient enough to wait more than 10minutes)

Tried. Not changed. upgrading nodejs version is not the right way, i guess