tag:blogger.com,1999:blog-8866592669665585195.post4430704489855952594..comments2024-02-10T14:08:31.576+02:00Comments on Red and Sensual Java: Faster than CYardenahttp://www.blogger.com/profile/15649241856669571499noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8866592669665585195.post-78314657842847599302007-12-13T11:48:00.000+02:002007-12-13T11:48:00.000+02:00Hi Greg,Well, if you look at Erik's response to th...Hi Greg,<BR/><BR/>Well, if you look at Erik's response to the thread on JVM-L, <B>-client</B> and <B>-server</B> are producing different results during run-time, so it obviously <I>is</I> a run-time optimization. <BR/><BR/>It appears to me that the optimization is not done by javac when compiling bytecode, but rather by JIT compiler when generating native executable from the bytecode.Yardenahttps://www.blogger.com/profile/15649241856669571499noreply@blogger.comtag:blogger.com,1999:blog-8866592669665585195.post-31288955886475199672007-12-13T00:59:00.000+02:002007-12-13T00:59:00.000+02:00How is this a benefit of the JVM or hot spot compi...How is this a benefit of the JVM or hot spot compilation?<BR/><BR/>Its a static pattern ... any compiler could have this case optimized. There is no run-time information being used in the optimization its just an optimization that simplifies useless code?!<BR/><BR/>n xored to n an even number of times is 0 and odd number of times is n. I can very easily make it so it just defines that as a constant and removes the loop all together.Travelling Greghttps://www.blogger.com/profile/12937333845136986760noreply@blogger.com