Another Reason Java is Faster than C (maybe)

Monday, March 12th, 2007

Paul S. R. Chisholm points out a new reason virtual machine based languages such as Java may sometimes outperform statically optimized languages such as C:

Portability depends on architecture (for example, x86 vs. PowerPC), but high performance depends on microarchitecture (for example, Pentium M vs. Athlon 64 X2). Today’s Core 2 chips have many high performance features missing from the 1993 original Pentiums. A good compiler like gcc can take advantage of those additional features. This is bad news if you’re using a binary Linux distribution, compiled to a lowest common denominator. It’s good news if you’re building and installing Linux from source, with something like Linux From Scratch or Gentoo/Portage. It’s also good news for just-in-time compilers (think Java, .NET, and Mono); they’re compiling on the “target” machine, so they can generate code tailored for the machine’s exact microarchitecture.

This sounds plausible in theory. What I don’t know is whether Java takes advantage of this in practice. Has anyone looked at the JIT source code lately? Can anyone say whether it makes any microarchitecture-specific optimizations?

IDE needed to Hack on PHP (not with PHP)

Friday, December 1st, 2006

A piece I’m writing for IBM developerWorks has turned into the article that ate Pittsburgh. Trying to understand and document a certain class keeps leading me deeper into PHP internals, and is revealing some bugs in a certain PHP extension bundled with PHP 5.1 and later. Naturally I want to fix these.

However it’s all C code, and I haven’t done any serious C work in 15 years. (I did write some C++ about eight years ago, but this is straight C, not C++.)

What IDE are folks using on the Mac (or alternately Linux) to hack PHP itself? Xcode? Eclipse with the C development tools installed? Something else? This is just a short quick open source patch project (I hope) so I’d prefer not to pay multiple hundreds of dollars; just use the simplest, quickest thing that will get the job done.
(more…)