From: Francis Cianfrocca Date: 2006-07-27T05:15:56+09:00 Subject: Re: For performance, write it in C Ron M wrote: > Not really. In C you can quite easily use inline assembly > to do use your chips MMX/SSE/VIS/AltiVec extensions and if > you need more, interface to your GPU if you want to use it > as a coprocessor. > > I don't know of any good way of doing those in Java except > by writing native extensions in C or directly with an assembler. > > Last I played with Java it didn't have a working cross-platform > mmap, and if that's still true, the awesome NArray+mmap Ruby > floating around is a good real-world example of this flexibility. Your point about Java here is very well-taken. I'd add that you don't even really need to drop into asm to get most of the benefits you're talking about. C compilers are really very good at optimizing, and I think you'll get nearly all of the available performance benefits from well-written C alone. (I've written at least a million lines of production asm code in my life, as well as a pile of commercial compilers for various languages.) It goes back to economics again. A very few applications will gain so much incremental value from the extra 5-10% performance boost that you get from hand-tuned asm, that it's worth the vastly higher cost (development, maintenance, and loss of portability) of doing the asm. A tiny number of pretty unusual apps (graphics processing, perhaps) will get a lot more than 10% from asm. The performance increment in going from Ruby to C is in *many* cases a lot more than 10%, in fact it can easily be 10,000%. -- Posted via http://www.ruby-forum.com/.