<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Dean Wampler's Mind: Tag BSF</title>
    <link>http://blog.aspectprogramming.com/articles_controller.rb/tag?tag=bsf</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ruminations and Ruinations on Software</description>
    <item>
      <title>Bean Scripting Framework Performance Problems</title>
      <description>&lt;p&gt;A Contract4J5 user reported performance problems using Groovy. After some investigation, it appears that using the Bean Scripting Framework (BSF) increases the overhead of script evaluation by a factor of 3 or so! The overhead for script evaluation is already very high (roughly a factor of 7-10 times slower compared to no contracts). Scripting is expensive if used heavily, as it is in &lt;span class="caps"&gt;C4J&lt;/span&gt;!!&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m not sure why &lt;span class="caps"&gt;BSF&lt;/span&gt;&amp;#8217;s overhead is so high, but I&amp;#8217;m going to implement support for Groovy and JRuby that bypasses &lt;span class="caps"&gt;BSF&lt;/span&gt;. This may take a while to complete, as I have a busy few weeks ahead.&lt;/p&gt;


	&lt;p&gt;The older non-BSF integration with Jexl is still in the distribution (although it&amp;#8217;s currently marked as deprecated). If you want to use it, put the following code in your &lt;code&gt;main&lt;/code&gt; or similar initialization methods:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_java "&gt;Contract4J c4j = Contract4J.getInstance();
ContractEnforcer ce = c4j.getContractEnforcer();
ce.setExpressionInterpreter (new JexlExpressionInterpreter());&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;&lt;b&gt;Correction:&lt;/b&gt; You can also use the properties file configurator or the Spring configuration file options to specify Jexl without the &lt;span class="caps"&gt;BSF&lt;/span&gt; wrapper.&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll get warnings that &lt;code&gt;JexlExpressionInterpreter&lt;/code&gt; is deprecated. You can safely ignore them. I&amp;#8217;ll remove that javadoc tag in the next minor update.&lt;/p&gt;


	&lt;p&gt;Longer term, I&amp;#8217;m trying to improve the use of caching to further reduce the overhead of &lt;span class="caps"&gt;C4J&lt;/span&gt;.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Mar 2007 10:03:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f612c3e5-c627-4ea3-a877-04a3f7feade5</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2007/03/02/bean-scripting-framework-performance-problems</link>
      <category>Contract4J</category>
      <category>Contract4J</category>
      <category>BSF</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/28</trackback:ping>
    </item>
  </channel>
</rss>
