-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module takes over 18 min to install and 5 min to load #134
Comments
Microsoft Graph is big surface area. This is a preview and we are working on ways to optimize the size. Perf on PS6/7 is noticeably better. The Microsoft.Graph module is a metamodule, if there are just parts of Microsoft Graph that you want to access, there are close to 100 smaller modules that you can pull in independently once you have Microsoft.Graph.Authentication installed. We are rolling out a process to allow us to only update the modules that have been recently updated, so that you should only pay the large install cost once. We hope to have the module pre-installed in the Azure Cloud Shell image, so there should be no install cost there. On my Thinkpad X1 Yoga i7 laptop, working from home, I just uninstalled and re-installed and it took just over 2 mins to install completely in PS6. Admittedly, I have a fast internet connection, so that may help. My pwsh.exe instance is showing 184MB of memory usage. We appreciate your feedback and will continue to make efforts to make the install process as painless as possible. |
The reason why it is faster in PowerShell Core, is because it has newer PowerShellGet and Packagemanagement modules. If you update them, then installation using PowerShell 5.1 should be much faster. With PowerShellGet v3 being developed at the moment, installation speed should generally become much faster. The Graph module could be a bit more pragmatic and reduce the number of modules by merging some, e.g. there are a lot of Microsoft.Graph.Identity.* modules that are probably not worth the maintenance and performance overhead of having so many individual modules. One of the things that is definitely partly responsible for the bad performancen of the module import is that most Graph modules use a wildcard for FunctionsToExport or CmdletsToExport in their manifest (psd1 file). This would be a low hanging fruit that should improve the import speed. For more details see: Having said, you shouldn't need to import the root module, just importing the modules that you need should help you in the meantime |
Closing this since we are actively working on reducing the SDK size in #428. This should reduce the overall install time. |
It's 2023 - I've just had to use the Install-Module cmdlet in Powershell 7 to install the Microsoft.Graph module - selected version 2.1.0 of that module - installation time was 20 minutes - lol |
Here for an update an to get infos about improvements regarding this topic. |
Tried to install Graph v2.12 - still taking too long Any update on this topic would be appreciated! |
Use PSResourceGet, and you will notice that it will install Microsoft Graph module under 1 minute. Read more here: https://www.alitajran.com/install-microsoft-powershell-psresourceget-module/ |
I'm trying to install Microsoft.Graph 2.18 - and the install still takes minutes, and the Import is also taking minutes. |
This module takes ages (understatement) to install and load.
In PS 5.1, install took 18 minutes and load took
In PowerShell 7.0, this module takes 5 minutes to import.
It also consumes a whopping 1.3gb of RAM when loaded. Just for giggles, I ran [gc]::Collect() and in PS7, RAM usage dropped 400MB. PS5.1 didn't drop much.
What is going on.
The text was updated successfully, but these errors were encountered: