This blog has moved to http://ThePowerShellGuy.com
Greetings /\/\o\/\/
I got a question on the last post how long my profile took to load.
I did not know but answered a bit less as a second (my MSH startuptime that is), and that this profile was still almost "clear".
but ofcourse it's is a good question, as you will notice this everytime you start-up MSH, and it's good to have a baseline for this.
To see what only the profile is doing, you can just put a stopwatch on it.
Start the profile.MSH with this :
$sw = new-object System.Diagnostics.Stopwatch
$sw.start()
and end with this :
$sw.stop()
then you can alway check on that $SW object later in the session, to see what the load time of the profile was.
and you can play with some items by remarking them in the profile so they are not processed and look what the effect is, so you can figure out what are the "expensive" items in it, .
for example the script as is now :
With .NET Ojects (Form and Clip)
MSH>$sw
IsRunning Elapsed ElapsedMilliseconds ElapsedTicks
--------- ------- ------------------- ------------
False 00:00:00.3216985 321 965147137
Without :
MSH>$sw
IsRunning Elapsed ElapsedMilliseconds ElapsedTicks
--------- ------- ------------------- ------------
False 00:00:00.1229599 122 368899440
also the drive workaround toke some time (not the functions as they are just declared)
b.t.w. you should measure a couple of time with the different settings, as the load time depents also on if it's the first time the Code gets loaded or the load of the computer at the time (also I noticed if you leave a shell for 12 hours or so, it will take some time to startup again (re-loading some .NET Obectes that are GC-ed ?)
so make shure your measurements are related, as they can differ if the status of the system changes between measurements, or the time between starting the MSH sessions, even if the settings do not change.
now you can check-up on your profile now and then to see if it still lives up to your start-time demands .
gr /\/\o\/\/