<?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: The 10 principles of Assembly Java</title>
	<atom:link href="http://blog.javia.org/assembly-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.javia.org/assembly-java/</link>
	<description>Android apps</description>
	<lastBuildDate>Fri, 05 Feb 2010 09:04:32 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Neil Harding</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-3030</link>
		<dc:creator>Neil Harding</dc:creator>
		<pubDate>Mon, 01 Feb 2010 21:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-3030</guid>
		<description>For the absolute best case in optimization for case 2, you should use -1,0,1 for the values then you can do

class Animal {
  static final int DOG=-1, CAT=1, MOUSE = 0;
  String saySomething(int kind) {
   if (kind  0) return &quot;meow&quot;;
   return &quot;squeak&quot;;
   }
}

this also allows you to do DOG &#124; CAT is != 0
CAT &#124; MOUSE &gt;= 0 etc

If you have a lot of cases then by grouping related ones into negative / positive you can use 0. The Java compiler is like the old C compilers back in the &#039;80s before any of the optimizations that were made (some C++ compilers can generate code that is almost as good as assembly, but since Java is already slow on Mobiles and size limited it is worth optimizing the code rather than letting the compiler, although a tool such as proguard means you can use more maintainable code, but it won&#039;t solve all your problems since it doesn&#039;t refactor the logic, just the generated code).</description>
		<content:encoded><![CDATA[<p>For the absolute best case in optimization for case 2, you should use -1,0,1 for the values then you can do</p>
<p>class Animal {<br />
  static final int DOG=-1, CAT=1, MOUSE = 0;<br />
  String saySomething(int kind) {<br />
   if (kind  0) return &#8220;meow&#8221;;<br />
   return &#8220;squeak&#8221;;<br />
   }<br />
}</p>
<p>this also allows you to do DOG | CAT is != 0<br />
CAT | MOUSE &gt;= 0 etc</p>
<p>If you have a lot of cases then by grouping related ones into negative / positive you can use 0. The Java compiler is like the old C compilers back in the &#8217;80s before any of the optimizations that were made (some C++ compilers can generate code that is almost as good as assembly, but since Java is already slow on Mobiles and size limited it is worth optimizing the code rather than letting the compiler, although a tool such as proguard means you can use more maintainable code, but it won&#8217;t solve all your problems since it doesn&#8217;t refactor the logic, just the generated code).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richeve Bebedor</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-2928</link>
		<dc:creator>Richeve Bebedor</dc:creator>
		<pubDate>Fri, 29 Jan 2010 17:32:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-2928</guid>
		<description>Added to my post i want to encourage this part because little things are sure to be forgotten XD what we want to achieve as a programmer is a program with fewer codes, maintainable and optimized to achieve that we need to explore. it is just a matter of combinations. i am saying as a programmer with a beginner&#039;s point of view thank you XD</description>
		<content:encoded><![CDATA[<p>Added to my post i want to encourage this part because little things are sure to be forgotten XD what we want to achieve as a programmer is a program with fewer codes, maintainable and optimized to achieve that we need to explore. it is just a matter of combinations. i am saying as a programmer with a beginner&#8217;s point of view thank you XD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richeve Bebedor</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-2927</link>
		<dc:creator>Richeve Bebedor</dc:creator>
		<pubDate>Fri, 29 Jan 2010 17:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-2927</guid>
		<description>these are good tips for mobile applications only but i appreciate it so much because for me, as a non mobile app programmer, code optimization is a very big consideration. this is a great help! thank you for having these principles XD</description>
		<content:encoded><![CDATA[<p>these are good tips for mobile applications only but i appreciate it so much because for me, as a non mobile app programmer, code optimization is a very big consideration. this is a great help! thank you for having these principles XD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-31</link>
		<dc:creator>Marco</dc:creator>
		<pubDate>Sun, 06 Jul 2008 11:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-31</guid>
		<description>All still highly relevant if you&#039;re trying for as much performance as possible.

I&#039;m writing a 3d game using mascot capsule, and even now in 2008 the hit from newing and method calls is enormous. As a result I performed many of the optimizations similar to the ones Mihai talks about and it&#039;s over doubled the game&#039;s speed.</description>
		<content:encoded><![CDATA[<p>All still highly relevant if you&#8217;re trying for as much performance as possible.</p>
<p>I&#8217;m writing a 3d game using mascot capsule, and even now in 2008 the hit from newing and method calls is enormous. As a result I performed many of the optimizations similar to the ones Mihai talks about and it&#8217;s over doubled the game&#8217;s speed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-27</link>
		<dc:creator>Amir</dc:creator>
		<pubDate>Tue, 09 Jan 2007 17:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-27</guid>
		<description>Good work Mihai.

On some of the many smaller handsets that we still have to support (our build list covers over 500 different j2me devices) then most of this post makes absolute sense.

Our apps have to run on very very slow, 64kj devices with less than 200k heap.  You&#039;re fighting for every byte on these devices, you better understand these concepts.  And we&#039;ll be supporting these devices for at least another 12 months.</description>
		<content:encoded><![CDATA[<p>Good work Mihai.</p>
<p>On some of the many smaller handsets that we still have to support (our build list covers over 500 different j2me devices) then most of this post makes absolute sense.</p>
<p>Our apps have to run on very very slow, 64kj devices with less than 200k heap.  You&#8217;re fighting for every byte on these devices, you better understand these concepts.  And we&#8217;ll be supporting these devices for at least another 12 months.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-26</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Wed, 13 Dec 2006 09:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-26</guid>
		<description>You&#039;ve certainly got the right approach to writing leaner, faster code, but you&#039;re missing the point with Java.  It&#039;s supposed to be maintainable!   I&#039;ve been an assembler programmer for over 20 years so I can agree with what you&#039;re saying, but if you&#039;re going to do this kind of stuff in assembler, make sure you don&#039;t do it at the expense of losing maintainability.  I can guarantee you that processor speeds will eventually catch up.</description>
		<content:encoded><![CDATA[<p>You&#8217;ve certainly got the right approach to writing leaner, faster code, but you&#8217;re missing the point with Java.  It&#8217;s supposed to be maintainable!   I&#8217;ve been an assembler programmer for over 20 years so I can agree with what you&#8217;re saying, but if you&#8217;re going to do this kind of stuff in assembler, make sure you don&#8217;t do it at the expense of losing maintainability.  I can guarantee you that processor speeds will eventually catch up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio Terreno</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-25</link>
		<dc:creator>Antonio Terreno</dc:creator>
		<pubDate>Wed, 13 Dec 2006 09:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-25</guid>
		<description>This post is pure rubbish!!!
What the hell are the obfuscators/optimizers for?
Better to have rubbish not maintainable code or maintainable code?</description>
		<content:encoded><![CDATA[<p>This post is pure rubbish!!!<br />
What the hell are the obfuscators/optimizers for?<br />
Better to have rubbish not maintainable code or maintainable code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javi.NET</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-24</link>
		<dc:creator>Javi.NET</dc:creator>
		<pubDate>Thu, 07 Dec 2006 09:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-24</guid>
		<description>When you have to develop a real time communications, event oriented, with more than 20k code lines, using only a code populated of Jappo macros so with only a click in a selected ant file you can generate and compile the same code for four different j2me platforms (each one with different profiles)... and do it while you keep the code legibility because protocols upgrades are usual, a easier code maintenance, and highly reliability... you can only remember this principles as a far echo in your head.

Sorry, but give me proguard instead now!</description>
		<content:encoded><![CDATA[<p>When you have to develop a real time communications, event oriented, with more than 20k code lines, using only a code populated of Jappo macros so with only a click in a selected ant file you can generate and compile the same code for four different j2me platforms (each one with different profiles)&#8230; and do it while you keep the code legibility because protocols upgrades are usual, a easier code maintenance, and highly reliability&#8230; you can only remember this principles as a far echo in your head.</p>
<p>Sorry, but give me proguard instead now!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mobmash blog &#187; Blog Archive &#187; links for 2006-12-07</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-23</link>
		<dc:creator>mobmash blog &#187; Blog Archive &#187; links for 2006-12-07</dc:creator>
		<pubDate>Thu, 07 Dec 2006 00:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-23</guid>
		<description>[...] The 10 principles of Assembly Java (tags: mobile java j2me software development) [...]</description>
		<content:encoded><![CDATA[<p>[...] The 10 principles of Assembly Java (tags: mobile java j2me software development) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cedric</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-22</link>
		<dc:creator>Cedric</dc:creator>
		<pubDate>Wed, 06 Dec 2006 19:49:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-22</guid>
		<description>Would have been fine advice five years ago, now most of these points are moot (and those that are not are taken care of by the obfuscator anyway).

Premature optimization is still the root of all evil...

--
Cedric</description>
		<content:encoded><![CDATA[<p>Would have been fine advice five years ago, now most of these points are moot (and those that are not are taken care of by the obfuscator anyway).</p>
<p>Premature optimization is still the root of all evil&#8230;</p>
<p>&#8211;<br />
Cedric</p>
]]></content:encoded>
	</item>
</channel>
</rss>
