question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Core and Extensions Are Extremely Slow to Load

See original GitHub issue

Versions

Autorest version: 3.0.6187 Node version: 12.18.1 @autorest/core: 3.0.6302 @microsoft.azure/autorest.csharp: 2.3.82 @microsoft.azure/autorest.modeler: 2.3.47 OS: Windows 10

Current Behavior

Any command including the --csharp flag spends multiple minutes sitting with the output

AutoRest code generation utility [cli version: 3.0.6187; node: v12.18.1, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest

Once this extremely long wait is complete messages for the modules loading are printed, following quickly by the output for the actual command.

This behavior occurs even when running the command autorest --csharp --help

Expected Behavior

Loading these modules should only take a few seconds, which was the case for me in the past.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pnquestcommented, Oct 9, 2020

I think it is possible the issue @finalcut is experiencing may be different from what I am seeing. Like I said, I see this even when running this command, which has nothing to do with generating any code:

autorest --csharp --help

I just tried running that command with the additional flags, but it looks like the timing starts after the long wait. The output suggests that this took 5 seconds, but it was actually multiple minutes. The time spent waiting is entirely between https://aka.ms/autorest being printed and the next line appearing.

autorest --csharp --help --debug --verbose
AutoRest code generation utility [cli version: 3.0.6187; node: v12.19.0, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      'redacted\AppData\Roaming\npm\node_modules\@autorest\core\dist' (3.0.6302)
No configuration found at 'file:///redacted/invalid.filename.md'.
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/inspect.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/directives.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/pipeline.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/loader-openapi.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/miscellaneous.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/patches.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-powershell.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-azureresourceschema.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-csharp.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-go.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-java.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-nodejs.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-php.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-python.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-ruby.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-typescript.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-validators.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-az.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/plugin-trenton.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/graphs.md'
   Including configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@autorest/core/resources/help-configuration.md'
   Loading local AutoRest extension '@microsoft.azure/autorest.csharp' (redacted\AppData\Roaming\npm\node_modules\@microsoft.azure\autorest.csharp)
   Including extension configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@microsoft.azure/autorest.csharp/README.md'
   Loading local AutoRest extension '@microsoft.azure/autorest.modeler' (redacted\AppData\Roaming\npm\node_modules\@microsoft.azure\autorest.modeler)
   Including extension configuration file 'file:///redacted/AppData/Roaming/npm/node_modules/@microsoft.azure/autorest.modeler/readme.md'
DEBUG [4.58 s]: pipeline-emitter - START inputs = 0
DEBUG [4.58 s]: configuration-emitter - START inputs = 0
DEBUG [4.58 s]: help - START inputs = 0
DEBUG [4.58 s]: help - END [0 s]
DEBUG [4.59 s]: pipeline-emitter - END [0 s]
DEBUG [4.59 s]: configuration-emitter - END [0 s]


Usage: autorest [configuration-file.md] [...options]

  See: https://aka.ms/autorest/cli for additional documentation

Overall Verbosity

  --verbose                     display verbose logging information
  --debug                       display debug logging information

Manage Installation

  --info                        display information about the installed version of autorest and its extensions
  --list-available              display available AutoRest versions
  --reset                       removes all autorest extensions and downloads the latest version of the autorest-core extension
  --preview                     enables using autorest extensions that are not yet released
  --latest                      installs the latest autorest-core extension
  --force                       force the re-installation of the autorest-core extension and frameworks
  --version=<string>            use the specified version of the autorest-core extension

Core Settings and Switches

  --help                        display help (combine with flags like --csharp to get further details about specific functionality)
  --input-file=<string | string[]>  OpenAPI file to use as input (use this setting repeatedly to pass multiple files at once)
  --output-folder=<string>      target folder for generated artifacts; default: "<base folder>/generated"
  --clear-output-folder         clear the output folder before writing generated artifacts to disk (use with extreme caution!)
  --base-folder=<string>        path to resolve relative paths (input/output files/folders) against; default: directory of configuration file, current directory otherwise
  --message-format=<"regular" | "json">  format of messages (e.g. from OpenAPI validation); default: "regular"
  --github-auth-token=<string>  OAuth token to use when pointing AutoRest at files living in a private GitHub repository
Core Functionality
   While AutoRest can be extended arbitrarily by 3rd parties (say, with a custom generator),
   we officially support and maintain the following functionality.
   More specific help is shown when combining the following switches with --help .

  --csharp                      generate C# client code
  --go                          generate Go client code
  --java                        generate Java client code
  --python                      generate Python client code
  --nodejs                      generate NodeJS client code
  --typescript                  generate TypeScript client code
  --ruby                        generate Ruby client code
  --php                         generate PHP client code
  --azureresourceschema         generate Azure resource schemas
  --model-validator             validates an OpenAPI document against linked examples (see https://github.com/Azure/azure-rest-api-specs/search?q=x-ms-examples )
  --azure-validator             validates an OpenAPI document against guidelines to improve quality (and optionally Azure guidelines)

C# Generator (activated by --csharp)

  --azure-arm                   generate code in Azure flavor
  --fluent                      generate code in fluent flavor
  --namespace=<string>          determines the root namespace to be used in generated code
  --license-header=<string>     text to include as a header comment in generated files (magic strings: MICROSOFT_MIT, MICROSOFT_APACHE, MICROSOFT_MIT_NO_VERSION, MICROSOFT_APACHE_NO_VERSION, MICROSOFT_MIT_NO_CODEGEN)
  --payload-flattening-threshold=<number>  max. number of properties in a request body. If the number of properties in the request body is less than or equal to this value, these properties will be represented as individual method arguments instead
  --add-credentials             include a credential property and constructor parameter supporting different authentication behaviors
  --override-client-name=<string>  overrides the name of the client class (usually derived from $.info.title)
  --use-internal-constructors   generate constructors with internal instead of public visibility (useful for convenience layers)
  --sync-methods=<"essential" | "all" | "none">  determines amount of synchronous wrappers to generate; default: essential
  --use-datetimeoffset          use DateTimeOffset instead of DateTime to model date/time types
  --client-side-validation=<boolean>  whether to validate parameters at the client side (according to OpenAPI definition) before making a request; default: true
  --max-comment-columns=<number>  maximum line width of comments before breaking into a new line
  --output-file=<string>        generate all code into the specified, single file (instead of the usual folder structure)
  --sample-generation           generate sample code from x-ms-examples (experimental)
  --static-serializer           generate client serlializer settings as a static member (experimental)
[4.62 s] Generation Complete
[4.62 s] Shutting Down.
[4.62 s] Exiting.
0reactions
lmazuelcommented, Mar 30, 2021

@pnquest can you confirm you still experience the issue with recent versions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve performance if Visual Studio is slow | Microsoft Learn
Solutions load much faster than in earlier versions, with performance ... You might have extensions installed that slow Visual Studio down.
Read more >
chrome is very slow to start up, i have minimal extensions ...
I have a very fast PC using Windows 10 on the latest version, with 32gb ram, 9900k CPU with all cores overclocked to...
Read more >
5 ways to fix Google Chrome when it's running slow
To fix Google Chrome when it's running slow, try clearing its cache or wiping the browser history. You can also try deleting unnecessary ......
Read more >
VS Code Intellisense is extremely slow - Stack Overflow
As per https://stackoverflow.com/a/69580343/2021554 when you are working with larger files, typically those which exceed 3k lines and have ...
Read more >
22 Ways To Speed Up A Slow Loading Website [2022]
If your website is loading slow, you can speed it up by using faster hosting, page builders, plugins, and images. Configuring a caching...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found