Presumably, the core components of this implementation have been licensed from Sun under a non-GPL license that allows Apple to create a platform specific derivative work. And the end result is that Java is much faster than C# and a much simpler implementation.Īpple provides their own non-GPL'd Java implementation. Java chose the way that was simplest but fast enough. In all these cases C# chose the way it thought was fastest but this made the CLR very complex. * embedded native code - C#'s bare-metal native code interface allows for faster access to small bits of native code, but it locks objects in place in memory a lot more making the gc more complicated. * 'real' generics - C# thought real generics would be faster by avoiding casts, but the complexity cost of following generic instance types prevents many optimizations such as method inlining that now save more time than casts (iirc CLR only inlined single methods less than 32 instructions and only if not overridden, vs Java inlining multiple method calls deep) This prevents the very efficient mixed-mode interpret followed by hotspot compile (for instance, Java can optimize the program using another core while it is running interpreted). * jit-only - C# thought that a jit would always be used because jit is 'faster', so their bytecode is not able to be interpreted effectively. * value types - now java can often automatically put objects on the stack and this makes the complexity cost of value types hardly worth the benefits. What's so interesting about it is that Microsoft's copy of Java, C#, was concerned about being the fastest language so they make a lot of hacky choices purely based on what they thought would be fastest. It's also quite irksome that they ignore most performance-related RFEs, simply promising that the magical JIT will fix everything in the next version. ![]() It's unfortunate, however, that Sun continues to pretend that they've already got it all figured out and running smoothly, when there is obviously so much more work to do. Certainly much more of an improvement than the past few versions. IMO the current Java 6 JVM is a pretty good first step towards this ideal JIT compiler maybe I'd qualify it as a very early alpha version of The Real Thing. However, failures in implementation aside, there are very good arguments that suggest that as we go forward, JIT compilers will eventually overtake statically compiled code when it comes to speed. (Though I'm told this version of Java is much better about this stuff, to be fair) Sun has been telling everyone for the past five years that the JVMs are so robust and intelligent that you don't need lightweight objects to do fast computation (for things like vector math), that you can just use plain old Java objects and the JVM will figure out how to optimize these, and anybody that's ever actually programmed some physics or graphics in Java knows that those claims are still crap. That's not to say this all currently works in practice, though. The best C compiler in the world just doesn't have the amount of information available that it would need to do things like this. The whole point of JIT is that it can use current information about how a program is running and do things like arrange objects in memory to increase the cache hit rate. Yes, the JIT compiler is written in C, but you are wrong that a better optimizing C compiler could beat a really good JIT. Sun take that code and open source it as well. Please Apple, finish Java 6 for the Macintosh and then hand the code over to Sun to make Java 7. Hopefully one that doesn't require a freaking OS upgrade to get the latest version of Java. It is in both parties interest to see a good JVM on the Macintosh. Some have suggested that Sun should be the one making a VM for Apple, and I would agree BUT Apple should have come to Sun two years ago and said that they were out of the JVM business and worked with Sun to insure a modern VM was on their platform. I would love to do my Java development on my Mac without using Parallels and XP. I do wish that Apple would release their GUI Java stuff under GPL, so people like this guy could get Java 6 with SWING out there ASAP. I own a Mac and run most (not all) of the stuff mentioned above. ![]() ![]() Make it just like they wanted to with the iPhone. Heck, now that I think about it, no programming languages at all. No C or C++, only that crappy C variant that Apple makes. Yeah, and lets add a few more to the list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |