<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Scripting Type Library Constant Injection Performance Characteristics, Part Three</title><link>http://blogs.msdn.com/b/ericlippert/archive/2005/07/07/436616.aspx</link><description>We’ve got a system that meets all our needs for disambiguating hierarchical constants through partial or full qualification. (In the event of a collision between an enumerated type name and a value in a given library, the type name wins so that full qualification</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>No SxS love from the Windows Script Host? &amp;laquo; KK&amp;#8217;s Blog</title><link>http://blogs.msdn.com/b/ericlippert/archive/2005/07/07/436616.aspx#4561000</link><pubDate>Sat, 25 Aug 2007 19:41:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4561000</guid><dc:creator>No SxS love from the Windows Script Host? « KK’s Blog</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://kobyk.wordpress.com/2007/08/25/no-sxs-love-from-the-windows-script-host/"&gt;http://kobyk.wordpress.com/2007/08/25/no-sxs-love-from-the-windows-script-host/&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4561000" width="1" height="1"&gt;</description></item><item><title>re: Scripting Type Library Constant Injection Performance Characteristics, Part Three</title><link>http://blogs.msdn.com/b/ericlippert/archive/2005/07/07/436616.aspx#437765</link><pubDate>Tue, 12 Jul 2005 04:16:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:437765</guid><dc:creator>Eric Lippert</dc:creator><description>Hey James,&lt;br&gt;&lt;br&gt;Use the Clone method.  When you clone an engine, all the persistent compiled code blocks are shared between the original and clone, so the cost of recompilation disappears.&lt;br&gt;&lt;br&gt;I've got a brief description of how ASP caches script engines and threads here:&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/ericlippert/archive/2003/09/18/53046.aspx"&gt;http://blogs.msdn.com/ericlippert/archive/2003/09/18/53046.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=437765" width="1" height="1"&gt;</description></item><item><title>re: Scripting Type Library Constant Injection Performance Characteristics, Part Three</title><link>http://blogs.msdn.com/b/ericlippert/archive/2005/07/07/436616.aspx#437582</link><pubDate>Mon, 11 Jul 2005 20:39:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:437582</guid><dc:creator>James Hugard</dc:creator><description>&amp;gt; but I'm surprised by the claim that it is only two orders of magnitude slower.&lt;br&gt;&lt;br&gt;Hmm... when I originally timed the difference, I had not even considered runtime costs.&lt;br&gt;&lt;br&gt;The quoted two-orders of magnitude was for the parse-time of several hundred constants, not execution time.  Since we load those constants for every script, and since we load thousands of scripts thousands of times per run, constants loading was one of the more expensive items at one point.&lt;br&gt;&lt;br&gt;On top of that, ATL in VC6 has a bug which occasionally causes simultanious type library requests to fail (I can find the KB number, if interested).&lt;br&gt;&lt;br&gt;For those reasons, I moved us to script-based constants rather then importing multiple typelibs.&lt;br&gt;&lt;br&gt;Today, our most expensive item is parse time, which runs about 4 times our average script execution time.  We have thousands of lines of script include files that get parsed for every script.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=437582" width="1" height="1"&gt;</description></item><item><title>re: Scripting Type Library Constant Injection Performance Characteristics, Part Three</title><link>http://blogs.msdn.com/b/ericlippert/archive/2005/07/07/436616.aspx#437576</link><pubDate>Mon, 11 Jul 2005 20:24:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:437576</guid><dc:creator>James Hugard</dc:creator><description>&amp;gt; and the ASP engine caches and reuses the compiled state over&lt;br&gt;&amp;gt; and over again without doing a recompilation&lt;br&gt;&lt;br&gt;How, pray tell, can I do this wonderful thing in my own code?  Recompilation is one of the most expensive things in our current script host.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=437576" width="1" height="1"&gt;</description></item><item><title>re: Scripting Type Library Constant Injection Performance Characteristics, Part Three</title><link>http://blogs.msdn.com/b/ericlippert/archive/2005/07/07/436616.aspx#437161</link><pubDate>Sat, 09 Jul 2005 22:40:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:437161</guid><dc:creator>Bob Riemersma</dc:creator><description>Alas, ASP pages and even intranet client-side DHTML is not the only case where VBScript and for that matter lots of typelib constants come in handy.&lt;br&gt;&lt;br&gt;WSH scripters can cope due to the &amp;lt;reference&amp;gt; tag available in .WSF format script source files.  Then again, few WSH scripts engage in truly long-lifetime multiple-use activities.  Here you still get the typelib penalty with little payback... but in such cases performance isn't paramount anyway.  The odd long-running WSH script still gets the benefit.&lt;br&gt;&lt;br&gt;Where the developer is truly in a bind is with HTAs.  Since there isn't any clean support for loading typelibs in IE, the HTA developer is just screwed.  Yet a given HTA might have as long a lifetime as any compiled application run on the desktop.  The execution model doesn't resemble ASP pages or typical web pages built with DHTML.  It's a lot more like a VB forms program.&lt;br&gt;&lt;br&gt;So an HTA developer using ADO or somesuch bag of components is reduced to importing long lists of Consts... or worse yet placing magic numbers all over the place.&lt;br&gt;&lt;br&gt;The result is that both HTAs and WSH scripts (since nobody writes .WSFs) end up laced with magic numbers, resulting in confusing code and maintenance headaches.  The .WSF-aversion probably stems directly from the fact that IE can't use this script source format.&lt;br&gt;&lt;br&gt;So a design decision (no typelib support in IE) meant to protect Johnny-no-teeth means none of us can have steak.  &amp;quot;Silly wabbit, script is for kids&amp;quot; seems to be the message here.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=437161" width="1" height="1"&gt;</description></item></channel></rss>