«

»

Sep 24

PowerCLI 5.8 release 1: Enhanced Performance

PowerCLI 5.8 release 1 has now been out for two weeks and some people are already noticing a difference in the startup speed of this latest release. What has happened? What has changed? well, we’ll get to that, just note that the first command run in a PowerCLI session prior to version 5.8 would take roughly 24 seconds to complete. Now, it takes 1 second. *Applause to the PowerCLI team!*

Ok ok, enough applause let’s get down into the nitty gritty and what was happening.

Understanding how PowerCLI works

Taking from a post done by Atanas Atanasov, You may notice in previous versions of PowerCLI that executing the first command would take much longer than any other command during that session. The reason behind this has to do with the fact that “the .Net framework compiles the underlying code on first use”. This means that any time you open a new session of PowerCLI, the .Net framework will compile the necessary code for your session upon first command execution.

The problem with this is that for many who utilize PowerCLI for monitoring purposes, these delays tend to stack up. Let’s face it, how many people want to wait 23 seconds (roughly) to start using a tool?

Well, thanks to feedback from the community, THIS HAS CHANGED!

What’s New

Instead of having the source code compiled during the first execution of each session, the PowerCLI installer actually compiles this code for us during installation. You may have seen that the installation takes a few seconds longer than previous versions, that is because the installer is precompiling the assemblies. This is a one-time action, which will allow all future PowerCLI sessions to load much quicker than in the past.

PowerCLI Install

Let’s take the following command used in Atanas’ blog post, and use it to measure the difference between previous versions of PowerCLI and PowerCLI 5.8r1.

Connect-VIServer …

Measure-Command { Get-VMHost } | fl TotalSeconds

Measure-Command { Get-VMHost } | fl TotalSeconds

This resulted in:

TotalSeconds : 23.4781061

TotalSeconds : 1.0336202

The same commands executed in this latest release show the following:

TotalSeconds : 1.0895574

TotalSeconds : 0.2280822

Measure-Object

As you can see, this decreased the time to execute the first command by 22 seconds, with subsequent commands running at .228 seconds. This is some fantastic stuff!

For those who are leveraging PowerCLI with their monitoring applications, we’d like to hear from you how this has helped.

Conclusion

As previously stated, 22 seconds may not seem like a lot at first, but it can definitely add up. We hope that as you upgrade PowerCLI to this latest version you can share with us comments about how this has helped you within your environments.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

3 × three =