<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Synergetic Stupidity in Java</title>
	<atom:link href="http://blog.javia.org/synergetic-stupidity-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.javia.org/synergetic-stupidity-in-java/</link>
	<description>Android apps</description>
	<lastBuildDate>Fri, 11 Nov 2011 12:16:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Designing Scalable Code Generators for very large Java Projects &#171; XTEXTerience</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-29432</link>
		<dc:creator>Designing Scalable Code Generators for very large Java Projects &#171; XTEXTerience</dc:creator>
		<pubDate>Fri, 04 Nov 2011 16:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-29432</guid>
		<description>[...] Berlin, Heidelberg, 2005. Preda, Mihai: Synergetic Stupidity in Java. Mihai Mobile Blog. 2009. http://blog.javia.org/synergetic-stupidity-in-java/  MoreLike this:LikeBe the first to like this [...]</description>
		<content:encoded><![CDATA[<p>[...] Berlin, Heidelberg, 2005. Preda, Mihai: Synergetic Stupidity in Java. Mihai Mobile Blog. 2009. <a href="http://blog.javia.org/synergetic-stupidity-in-java/" rel="nofollow">http://blog.javia.org/synergetic-stupidity-in-java/</a>  MoreLike this:LikeBe the first to like this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wow</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-18365</link>
		<dc:creator>wow</dc:creator>
		<pubDate>Fri, 15 Apr 2011 08:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-18365</guid>
		<description>brezel,
the article is very far from nonsense.  it is very accurate.  your comment is nonsense and shows that you don&#039;t understand the difference between run-time and compile-time. FAIL</description>
		<content:encoded><![CDATA[<p>brezel,<br />
the article is very far from nonsense.  it is very accurate.  your comment is nonsense and shows that you don&#8217;t understand the difference between run-time and compile-time. FAIL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brezel</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-3128</link>
		<dc:creator>brezel</dc:creator>
		<pubDate>Tue, 02 Feb 2010 19:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-3128</guid>
		<description>this article is nonsense.

public class Main {
    static int entries = 100000000;
    static byte[] barr = new byte[entries];

    static {
        System.err.println(Runtime.getRuntime().totalMemory());
        for (int i = 0; i &lt; entries; i++) {
            barr[i] = new Byte(&quot;1&quot;);
        }
        System.err.println(barr.length);
        System.err.println(Runtime.getRuntime().totalMemory());
    }

    public static void main(String[] args) {
        
    }
}</description>
		<content:encoded><![CDATA[<p>this article is nonsense.</p>
<p>public class Main {<br />
    static int entries = 100000000;<br />
    static byte[] barr = new byte[entries];</p>
<p>    static {<br />
        System.err.println(Runtime.getRuntime().totalMemory());<br />
        for (int i = 0; i &lt; entries; i++) {<br />
            barr[i] = new Byte(&quot;1&quot;);<br />
        }<br />
        System.err.println(barr.length);<br />
        System.err.println(Runtime.getRuntime().totalMemory());<br />
    }</p>
<p>    public static void main(String[] args) {</p>
<p>    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Harding</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-3025</link>
		<dc:creator>Neil Harding</dc:creator>
		<pubDate>Mon, 01 Feb 2010 17:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-3025</guid>
		<description>I wrote a bytecode optimizer for J2ME when I worked at I-Play (Digital Bridges at that time). Because of the cost of adding a new class, it makes sense to do store objects inside int arrays.

public final static int X = 0;
public final static int Y = 1;
public final static int z = 2;
public final static int IMAGE_INDEX = 3;
public final static int SPRITE_SIZE = 4;

So that you can do draw(sprites[index + X],sprites[index + Y],sprites[index + IMAGE_INDEX])

However, Javac is very bad compiler and actually generates code index + 0 (rather than saying +0 is not actually much use and removing it).

So I removed that code, and some other optimizations and one of them I did was to replace code like
static final byte B[] = {10, 20, 30, 40, 50, 60, 70, 80, …};

with static final byte B[] = Bytecode::ArrayFromString(&quot;encodedString&quot;,offset), the encoded string was generated via the optimizer and occurred once in the class pool and had simple run length encoding as well (the other option would have been to load the data from a resource, but the string encoding was the simplest since I didn&#039;t need to worry about it not being available).</description>
		<content:encoded><![CDATA[<p>I wrote a bytecode optimizer for J2ME when I worked at I-Play (Digital Bridges at that time). Because of the cost of adding a new class, it makes sense to do store objects inside int arrays.</p>
<p>public final static int X = 0;<br />
public final static int Y = 1;<br />
public final static int z = 2;<br />
public final static int IMAGE_INDEX = 3;<br />
public final static int SPRITE_SIZE = 4;</p>
<p>So that you can do draw(sprites[index + X],sprites[index + Y],sprites[index + IMAGE_INDEX])</p>
<p>However, Javac is very bad compiler and actually generates code index + 0 (rather than saying +0 is not actually much use and removing it).</p>
<p>So I removed that code, and some other optimizations and one of them I did was to replace code like<br />
static final byte B[] = {10, 20, 30, 40, 50, 60, 70, 80, …};</p>
<p>with static final byte B[] = Bytecode::ArrayFromString(&#8220;encodedString&#8221;,offset), the encoded string was generated via the optimizer and occurred once in the class pool and had simple run length encoding as well (the other option would have been to load the data from a resource, but the string encoding was the simplest since I didn&#8217;t need to worry about it not being available).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ldso</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-136</link>
		<dc:creator>ldso</dc:creator>
		<pubDate>Wed, 25 Mar 2009 13:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-136</guid>
		<description>Hahaha yikes.  That is surprising to me.  Well, not really.  I&#039;ve been working on a Java ME project for about a year, and most of the work has been writing test code to see which cases the api actually works for, because most of them don&#039;t.  But I have all of the functionality I was trying to get so far.  Good work figuring out why your &quot;code too large&quot; errors were happening.  Arbitrary limits like that are not surprising in desktop software, but that is wrong.  Thanks for making me laugh, Stupidity Boost made my day :)</description>
		<content:encoded><![CDATA[<p>Hahaha yikes.  That is surprising to me.  Well, not really.  I&#8217;ve been working on a Java ME project for about a year, and most of the work has been writing test code to see which cases the api actually works for, because most of them don&#8217;t.  But I have all of the functionality I was trying to get so far.  Good work figuring out why your &#8220;code too large&#8221; errors were happening.  Arbitrary limits like that are not surprising in desktop software, but that is wrong.  Thanks for making me laugh, Stupidity Boost made my day <img src='http://blog.javia.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

