/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" Tuning MSH in your Profile "," Einstein 2 + subtopic. "," Burn MSH ?? "," Monad and Adam (and a preview of my to-be AD provi... "," Windows MineSweeper cheat "," erroraction on new-item, my Wrong use of Stringbui... "," MSH Minesweeper GUI game "," MSH get-WmiMethodHelp (GWM) Update + format tips. "," More on Cryptograpy and MSH "," Get-credential and Decrypting a SecureString in MS... "," ")

Friday, November 25, 2005

 


Timing the loading of your profile in MSH



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\/\/


Comments:
Anonymous lee
You can also explore the time-expression command, it is helpful to measure the length that operations take.
 
Post a Comment

Links to this post:

Create a Link



<< Home

Archives

October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Google
 
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?