Created
July 1, 2016 12:50
-
-
Save michaeltlombardi/7900befecd09046970cba27c01cdd05f to your computer and use it in GitHub Desktop.
Tests the average module load time of a single-file module versus a module with one file per function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$MultiFileResults = @() | |
$SingleFileResults = @() | |
$MultiFileModulePath = '.\SomeModule.psd1' | |
$SingleFileModulePath = '.\Build\SomeModule\SomeModule.psd1' | |
for ($i=0;$i -lt 100; $i++){ | |
rmo SomeModule | |
$MultiFileResults += Measure-Command -Expression {ipmo $MultiFileModulePath} | Select -expand TotalMilliseconds | |
rmo SomeModule | |
$SingleFileResults += Measure-command -Expression {ipmo $SingleFileModulePath} | Select -expand TotalMilliseconds | |
} | |
$MultiFileResults | Measure-Object -Average | |
$SingleFileResults | Measure-Object -Average |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment