Expensive dot-sourcing in PowerShell modules, revisited
A PowerShell module I use has 200+ functions split into a single file each and about 17kloc. It was taking about 30s to load so I started looking for ways to shave time off.
If you've done the same then you'll know few years ago Bartek Bielawsk wrote a post about Expensive dot-sourcing. The gist of it is as follows:
- Dot sourcing individual files is slow.
- Using .NET functions to read the file first is faster.