<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   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/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Mike`s Blog - Java</title>
    <link>http://www.java-community.de/</link>
    <description>Keep it simple, stupid!</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Booting a JVM</title>
    <link>http://www.java-community.de/archives/157-Booting-a-JVM.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/157-Booting-a-JVM.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=157</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=157</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/bytecode-interpreter.png&#039;&gt;&lt;!-- s9ymdb:175 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;110&quot; height=&quot;80&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/bytecode-interpreter.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;I&#039;m right in the middle of implementing &lt;strong&gt;an interpreter for JVM bytecode&lt;/strong&gt;. Today was the first time the system printed out the magic &quot;Hello World!&quot; message.&lt;br /&gt;
&lt;br /&gt;
The interpreted boot time for running on a JDK 1.6 host (i&#039;m reusing their classes) is 4667ms. It takes 10ms to execute &lt;code&gt;System.out.printlnt(&quot;Hello World!&quot;);&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
Starting up the Virtual Machine and executing any class is pretty easy:&lt;br /&gt;
&lt;pre class=&quot;java&quot;&gt;
final VirtualMachine vm = new VirtualMachine();

final Classpath classpath = new Classpath();
classpath.addLoader(new HostVMResourceLoader()); // Re-uses JDK classes
classpath.addFolder(&quot;C:/Example/bin&quot;); // The HelloWorld project
vm.setClasspath(classpath);

vm.start();

vm.execute(&quot;org/example/HelloWorld&quot;);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The output can be seen in the screenshot:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/uploads/bytecode-interpreter-output.png&#039;&gt;&lt;!-- s9ymdb:176 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;400&quot; height=&quot;200&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/bytecode-interpreter-output.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The following is an histogram of the bytecodes being executed, only to start up and initialize the JVM.&lt;br /&gt;
That includes booting up the System class, character sets, ThreadGroups, Reflection, NIO, and a lot of native methods which had to be replaced.&lt;br /&gt;
&lt;pre&gt;
[01] aconst_null                3398 invocations
[02] iconst_m1                    31 invocations
[03] iconst_0                  33689 invocations
[04] iconst_1                  11795 invocations
[05] iconst_2                    445 invocations
[06] iconst_3                    181 invocations
[07] iconst_4                    121 invocations
[08] iconst_5                     57 invocations
[09] lconst_0                     18 invocations
[0a] lconst_1                      3 invocations
[0b] fconst_0                     19 invocations
[10] bipush                    58215 invocations
[11] sipush                      222 invocations
[12] ldc                        1287 invocations
[13] ldc_w                       494 invocations
[14] ldc2_w                       15 invocations
[15] iload                    362633 invocations
[16] lload                         5 invocations
[19] aload                     81878 invocations
[1a] iload_0                  100335 invocations
[1b] iload_1                  236106 invocations
[1c] iload_2                    1208 invocations
[1d] iload_3                    1383 invocations
[1e] lload_0                       3 invocations
[1f] lload_1                       4 invocations
[20] lload_2                       6 invocations
[22] fload_0                      15 invocations
[24] fload_2                      52 invocations
[25] fload_3                      24 invocations
[26] dload_0                       1 invocations
[2a] aload_0                  306476 invocations
[2b] aload_1                   43405 invocations
[2c] aload_2                   25744 invocations
[2d] aload_3                   83195 invocations
[32] aaload                      794 invocations
[33] baload                        6 invocations
[34] caload                    78421 invocations
[36] istore                   161005 invocations
[37] lstore                        2 invocations
[3a] astore                    26685 invocations
[3b] istore_0                      2 invocations
[3c] istore_1                    907 invocations
[3d] istore_2                    121 invocations
[3e] istore_3                    185 invocations
[3f] lstore_0                      1 invocations
[40] lstore_1                      2 invocations
[41] lstore_2                      3 invocations
[4b] astore_0                     35 invocations
[4c] astore_1                    742 invocations
[4d] astore_2                   2411 invocations
[4e] astore_3                  19006 invocations
[4f] iastore                      20 invocations
[53] aastore                    1654 invocations
[54] bastore                      19 invocations
[55] castore                     265 invocations
[57] pop                         808 invocations
[58] pop2                          4 invocations
[59] dup                        4418 invocations
[5a] dup_x1                        4 invocations
[5c] dup2                          1 invocations
[60] iadd                      86425 invocations
[61] ladd                          1 invocations
[64] isub                      61816 invocations
[68] imul                        814 invocations
[6a] fmul                         11 invocations
[70] irem                        135 invocations
[78] ishl                          8 invocations
[7a] ishr                          9 invocations
[7c] iushr                         8 invocations
[7e] iand                        163 invocations
[7f] land                          1 invocations
[80] ior                       25086 invocations
[81] lor                           1 invocations
[82] ixor                          8 invocations
[84] iinc                      29597 invocations
[85] i2l                           1 invocations
[86] i2f                          17 invocations
[8b] f2i                          11 invocations
[91] i2b                          13 invocations
[92] i2c                       25083 invocations
[94] lcmp                         13 invocations
[95] fcmpl                        19 invocations
[96] fcmpg                        19 invocations
[99] ifeq                      25358 invocations
[9a] ifne                      42109 invocations
[9b] iflt                     102593 invocations
[9c] ifge                      12405 invocations
[9d] ifgt                         27 invocations
[9e] ifle                       6280 invocations
[9f] if_icmpeq                 51280 invocations
[a0] if_icmpne                   813 invocations
[a1] if_icmplt                 77656 invocations
[a2] if_icmpge                 52068 invocations
[a3] if_icmpgt                    73 invocations
[a4] if_icmple                    52 invocations
[a5] if_acmpeq                  1612 invocations
[a6] if_acmpne                  2072 invocations
[a7] goto                      66816 invocations
[a8] jsr                           1 invocations
[a9] ret                           1 invocations
[ab] lookupswitch                  1 invocations
[ac] ireturn                  164404 invocations
[ad] lreturn                       6 invocations
[b0] areturn                   14314 invocations
[b1] return                     6938 invocations
[b2] getstatic                 39043 invocations
[b3] putstatic                   201 invocations
[b4] getfield                 310885 invocations
[b5] putfield                  15212 invocations
[b6] invokevirtual            102940 invocations
[b7] invokespecial              3603 invocations
[b8] invokestatic              65929 invocations
[b9] invokeinterface           13227 invocations
[bb] new                         950 invocations
[bc] newarray                     40 invocations
[bd] anewarray                   477 invocations
[be] arraylength                 764 invocations
[c0] checkcast                 23360 invocations
[c1] instanceof                   55 invocations
[c2] monitorenter                151 invocations
[c3] monitorexit                 151 invocations
[c6] ifnull                    15595 invocations
[c7] ifnonnull                 19950 invocations

Total: 3118655

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Three million bytecode instructions executed to get a little message on the screen.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 01 Mar 2011 23:49:00 +0100</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/157-guid.html</guid>
    
</item>
<item>
    <title>Spatial search with Lucene</title>
    <link>http://www.java-community.de/archives/156-Spatial-search-with-Lucene.html</link>
            <category>Java</category>
    
    <comments>http://www.java-community.de/archives/156-Spatial-search-with-Lucene.html#comments</comments>
    <wfw:comment>http://www.java-community.de/wfwcomment.php?cid=156</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.java-community.de/rss.php?version=2.0&amp;type=comments&amp;cid=156</wfw:commentRss>
    

    <author>info@mhaller.de (Mike Haller)</author>
    <content:encoded>
    At the Hadoop Hackathon this weekend at Sybit, we&#039;ve worked on a getting tiled images into HDFS and HBase. A side-story was how to search for these tiles based on GPS coordinates. I took the task to see how you can perform queries based on spatial coordinates. That is, searching for locations which are within a specified radius from an origin:&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/archives/156-Spatial-search-with-Lucene.html&#039;&gt;&lt;!-- s9ymdb:170 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;98&quot; height=&quot;110&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/CartesianGridAnimated.serendipityThumb.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://www.java-community.de/archives/156-Spatial-search-with-Lucene.html&#039;&gt;&lt;!-- s9ymdb:174 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;79&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://www.java-community.de/uploads/5Miles.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.java-community.de/archives/156-Spatial-search-with-Lucene.html#extended&quot;&gt;Continue reading &quot;Spatial search with Lucene&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 16 Oct 2010 21:52:10 +0200</pubDate>
    <guid isPermaLink="false">http://www.java-community.de/archives/156-guid.html</guid>
    
</item>

</channel>
</rss>
