<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>waelchatila.com - bean tag</title>
  <link>http://waelchatila.com:80/tags/bean/</link>
  <description>Notes on Software, Engineering and Science</description>
  <language>en</language>
  <copyright>Wael Chatila</copyright>
  <lastBuildDate>Thu, 11 Mar 2010 03:23:48 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Groovy vs BeanShell</title>
    <link>http://waelchatila.com:80/2007/05/09/1178775480000.html</link>
    
      
        <description>
          Below is a quick and dirty test to compare the speed performance between bean shell and groovy. Bean shell is an order of magnitude faster. If you don&#039;t need groovy closure and other nice groovy features...just use bean shell. It&#039;s only one small jar away.


&lt;div class=&#034;codeSample&#034;&gt;
public static void main(String[] args) throws EvalError {
        StringBuilder script = new StringBuilder();
        for (int i=0;i&lt;900;i++) {
            script.append(&#034;res&#034;);
            script.append(i);
            script.append(&#034;=&#034;);
            script.append(i+&#034;+&#034;+i+&#034;*&#034;+i);
            script.append(&#034;;\n&#034;);
        }
        GroovyShell groovyShell = new GroovyShell();
        Interpreter bsh = new Interpreter();

        long t = System.currentTimeMillis();
        groovyShell.evaluate(script.toString());
        System.out.println(System.currentTimeMillis() - t);

        t = System.currentTimeMillis();
        for (int i=0;i&lt;1000;i++) {
            int j = i+i*i;
        }
        System.out.println(System.currentTimeMillis() - t);

        t = System.currentTimeMillis();
        bsh.eval(script.toString());
        System.out.println(System.currentTimeMillis() - t);

    }
&lt;/div&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://waelchatila.com:80/2007/05/09/1178775480000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2007/05/09/1178775480000.html</guid>
    <pubDate>Thu, 10 May 2007 05:38:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>

