LWN.net Logo

A very grumpy editor's thoughts on Oracle

A very grumpy editor's thoughts on Oracle

Posted Aug 17, 2010 18:11 UTC (Tue) by pj (subscriber, #4506)
Parent article: A very grumpy editor's thoughts on Oracle

> This is not an attack on free software in general, despite the fact that Google would like to see the community view it that way. It is an attack on a specific platform (much of which is free software) .... Even if Oracle gets everything it wants, the damage to the wider free software community will be limited. We were strong before the advent of Android, and would remain strong if it were to be removed from the scene.

It's at least an attack on the free software that's part of the Android platform, including the Apache Harmony project.

And don't forget to mention that Groklaw will be covering this one, for whatever that's worth.


(Log in to post comments)

GNU Java compiler

Posted Aug 17, 2010 18:45 UTC (Tue) by southey (subscriber, #9466) [Link]

It is also has implications for the GNU Java compiler because the suit also appears to be also control of the Java language. Especially about writing an interpreter for the actual language and how create an executable program. It will make it hard to do that if Oracle America wins.

GNU Java compiler

Posted Aug 17, 2010 23:47 UTC (Tue) by ncm (subscriber, #165) [Link]

Amusingly, Oracle's patents don't cover a non-JIT compiler. Google could step around most of their troubles by including a Dalvik byte-code to machine-code compiler (based, perhaps, on Gcj) that runs when the bytecode objects are installed, rather then when they are executed. Android phones might need some more memory, then, but memory is still getting cheaper fast. It would be the more amusing if this resulted in better performance all around.

If Google were to abandon the JVM/Dalvik model and switch to a more optimizable intermediate representation, such as LLVM's, performance would be better still. That would, in turn, open up Android development to a much wider range of languages, and could make porting iPhone programs to Android much easier.

Dalvik and JIT

Posted Aug 18, 2010 9:34 UTC (Wed) by smurf (subscriber, #17840) [Link]

That's interesting, because last time I looked (see the presentation slides), Dalvik didn't have a JIT compiler.

Dalvik and JIT

Posted Aug 18, 2010 11:07 UTC (Wed) by dgm (subscriber, #49227) [Link]

Acording to Wikipedia, as of Android 2.2 it does.

Dalvik and JIT

Posted Aug 18, 2010 14:28 UTC (Wed) by smurf (subscriber, #17840) [Link]

Ah. Thanks. That's one patent which might be somewhat relevant, then, though I suspect there's a lot of prior art there. Forth systems, for instance, do something like this since the 1970s.

GNU Java compiler

Posted Aug 25, 2010 14:53 UTC (Wed) by Blaisorblade (guest, #25465) [Link]

> [About non-JIT performance] It would be the more amusing if this resulted in better performance all around.
Don't take it as an offense, but that's nonsense, and let a student of Virtual Machine implementation explain why.

The reason to use JIT compilation is that Java programs can't run fast without profile-guided optimizations - a JIT can inline virtual function calls easily (after checking the exact class of the target object with a guard, but that's a perfectly predictable branch). That's something C++ can't do.

Also, last time I tried Eclipse compiled with GCJ, it was IIRC 5 times slower in startup than the standard guy - enough to make me uninstall it. That doesn't mean anything per se, but I still wanted to point that out.

About LLVM, it has a great potential. But LLVM's JIT compiler was not _that_ good when Google's engineers working on Unladen Swallow tried using it.
So, yeah, in the long run basing a JVM on LLVM might be just the right move, for the sake of reuse, but you need to merge all HotSpot optimizations in LLVM, and then you would enjoy also a big-iron parallel GC even using Unladen Swallow, if those people ever manage removing the Global Interpreter Lock, their version of the Big Kernel Lock.

GNU Java compiler

Posted Aug 26, 2010 7:28 UTC (Thu) by linuxrocks123 (guest, #34648) [Link]

There is no fundamental reason C++ could not do this. The optimization you are describing is partial evaluation and is well-known. Profiling data would be helpful to know when to perform the partial evaluation transformation, but static compilers can use profiling data generated from an instrumented executable.

---linuxrocks123

GNU Java compiler

Posted Aug 27, 2010 16:51 UTC (Fri) by Blaisorblade (guest, #25465) [Link]

That's not partial evaluation - my explanation was confusing. And partial evaluation (p.e.) is still unusable in practice in most cases (PyPy is the only known real-world exception I believe, and it's not really p.e.).

Sorry, I was very unclear - when I wrote "checking the exact class of the target object with a guard", I meant that the inlined code is executed only after checking, at runtime, the class of the receiver. So
  a.method(args);
becomes
  if (a.getClass() == expectedClass)
    call expectedClass_method(a, args);
  else
    //normal call dispatch
and you need profiling data to choose expectedClass. There are few cases in which they are not needed, mostly on final methods or on classes which currently have no subclasses (loading new classes might invalidate this assumption and cause the generated code to be thrown away).

This is a case of run-time algorithm specialisation, and IMHO it's related but different from p.e.

I was a bit sloppy, but the "impossibility" of C++ is actually more an effect of the lack of a virtual machine during C++ execution, in most cases (yes, I know Managed C++, that's the exception).

Profile-guided optimization could be applied to programs in non-VM-based languages - but I don't know of, say, mainstream Linux distributions doing this, even on specific cases.
This is not only due to convenience issues: a good reason is that the profile can be workload-dependent, and you don't necessarily have a gain when you use the wrong profile - I've read examples of this in some paper that I don't remember, but I hope the plausibility is clear enough.
Indeed, in VMs it's interesting the ability to adapt to changes in program behavior.

From my knowledge about p.e., derived from discussions with fellow PhD students and accounts on Wikipedia and PyPy docs (they used p.e., and stopped doing it), general p.e. techniques are well known as being difficult to use, because performance of programs using them is difficult to predict; that's cited as a reason for the invention of MetaML, an environment for staged compilation, where p.e. is explicitly controlled, and for the abandonment of the previous PyPy's JIT compiler [1]. Currently they have reimplemented a form of runtime specialization through tracing JIT compilation, which seems rather different from traditional techniques - in particular, it can't optimize an unmodified RPython program.
See here for a discussion about unpredictable optimizations in general.

The optimization I describe is well-known, except by, say, CPython implementors (and by Ruby implementors up to Ruby 1.8), together with a set of well-known results from the past 30 years (like "don't use reference counting" and other stuff - see these papers).

[1] "performance instability: change a seemingly unrelated bit in your source program, and the performance changes in unexpected ways, which is clearly not desirable". It's not clear whether it's related to p.e., until after reading the paper about MetaML.

GNU Java compiler

Posted Sep 21, 2010 0:02 UTC (Tue) by linuxrocks123 (guest, #34648) [Link]

I was using partial evaluation a little more broadly than you, and I understood you the first time :)

You're right that profiling isn't widely used on Linux yet, mostly, I believe, due to inertia. However, the Firefox build for Windows is compiled with the benefit of profiling data. It's not compiled with profiling on Linux only because Mozilla doesn't think it's worth the engineering effort to make it work with GCC. If you had profiling data, you could do algorithm specialization (which is really just a special case of partial evaluation IMHO) very easily.

Also, bear in mind that this is just one, small performance optimization. C++ beats Java with respect to many others.

---linuxrocks123

GNU Java compiler

Posted Aug 18, 2010 1:53 UTC (Wed) by coriordan (guest, #7544) [Link]

That's kinda mitigated by Oracle being a member of OIN and libgcj and GCC being on OIN's list of protected software packages. ...but the extent of OIN's protection is sometimes unclear.

I'm trying to untangle it here:
http://en.swpat.org/wiki/Java_and_patents

A very grumpy editor's thoughts on Oracle

Posted Aug 17, 2010 20:42 UTC (Tue) by hingo (guest, #14792) [Link]

Yet again our Editor, despite being so Grumpy, has at least been able to collect his thoughts to use what little information is out there to write a coherent article without indulging in much speculation. But this one piece I too didn't get the logic of:

This is not an attack on free software in general, despite the fact that Google would like to see the community view it that way. It is an attack on a specific platform (much of which is free software) by a rapacious company which has just bought an expensive asset and wants to squeeze some revenue from it. It seems quite likely that this suit would have happened in the same way if Dalvik were proprietary.

It is not about Oracle or Google being good or bad, but how is this not an attack on free software??? Oracle is suing Google for Dalvik, which is 100% FOSS. They are not suing for any of the proprietary parts.

Especially the last sentence I don't get. For instance when Microsoft sued TomTom for using Linux (the vfat patents), would you have written that "...it seems quite likely Microsoft would have sued TomTom in the same way if Linux were proprietary?" Quite obviously they would have, but I don't see the relevance. Of course it was an attack on free software?

A very grumpy editor's thoughts on Oracle

Posted Aug 17, 2010 21:55 UTC (Tue) by mikov (subscriber, #33179) [Link]

I agree. Actually even if hypothetically Dalvik was proprietary software, this would still be an attack against Free Software - prohibiting new implementations goes against the very core of what Free Software stands for.

We now know for sure that all independent Java implementations (and there are quite a few of them, including GCJ) are at least as vulnerable as Dalvik. If Oracle wanted, they have the means to shut them down. They won't bother simply because none of the alternative implementations has become important. That is not very reassuring.

So how is this not an attack on free software? I would say it is the single biggest attacks since SCO. In a sense it is even bigger because while SCO was on shaky ground from the beginning, Oracle is _extremely_ likely to win this case in court.

A very grumpy editor's thoughts on Oracle

Posted Aug 18, 2010 0:36 UTC (Wed) by eou (guest, #69609) [Link]

Why would they be "extremely" likely to win?

It seems to me those patents are all trivial, and thus Google should have at least a decent chance of winning if they keep fighting indefinitely (hopefully, almost certainty, but IANAL).

Of course, if Google settles without buying the patents (or equivalently, an unlimited license for everyone), it would be a disaster.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds