The Source for Java Technology Collaboration
User: Password:



Osvaldo Pinali Doederlein's Blog

J2SE Archives


Java SE 5.0 Update 8's cool performance fixes

Posted by opinali on August 11, 2006 at 01:17 PM | Permalink | Comments (0)

Java SE 5.0 Update 8 is available. Besides the traditional few dozens of bugfixes, this release closes a number of important performance bugs in the JIT compiler, GC and runtime. So even if you play more in the conservative side, it's a great time to evaluate and upgrade your Java runtime.

One of the fixed perf bugs is Bug 4803284: Bad performance when HotSpot cannot optimize polymorphic calls, which I reported in January 2003 against JDK 1.4.1. That bug received a partial fix with Tiger-b28, when Sun promised the full solution "in next major release" (Mustang), splitting this to Bug 5074577. There's also a dupe, Bug 4898726: Nonstatic method calls take lot more time than static method calls. Well, it seems Sun kept the promise and these bugs are all fully solved now!

I obviously had to re-run my MethodBench (included in the bug report) to see if the new fix did any difference (as the partial fix already made me happy). And it does, only for HotSpot Server:

JDK 5.0 Update 7:

D:\Java\Bench\Method>java -server -Xbatch MethodHard
*** Testing (Hard) ***
Interf  TPoly   Poly    Virtual Final   Static  Native
35,530  25,682  01,155  01,155  01,146  01,138  259,300

JDK 5.0 Update 8:

D:\Java\Bench\Method>java -server -Xbatch MethodHard
*** Testing (Hard) ***
Interf  TPoly   Poly    Virtual Final   Static  Native
14,754  23,599  01,134  01,130  01,134  01,134  254,700

JDK 6.0 build 94:

D:\Java\Bench\Method>java -server -Xbatch MethodHard
*** Testing (Hard) ***
Interf  TPoly   Poly    Virtual Final   Static  Native
13,711  25,318  01,142  01,146  01,146  01,155  67,980

(The Reflection test is very slow in the "Hard" case, and I'm in a hurry now.)

The improvement is in the Interf test (interface calls), where both 5.0u8 and Mustang beat u7 in 14ns vs. 35ns per call. Other tests show only marginal improvements. Well, in a world full of complex frameworks abusing of interfaces, this optimization may be significant. And this is for a "hard" test where the compiler cannot infer a single concrete type (devirtualization). See the relevant benchmark code:

public void bench ()
{
	int calls = operations / 1000;
	// Note: HelperB and HelperD are unrelated classes (don't inherit each other),
	// but both implement the polyHardF() method defined by HelperInterface.
	HelperInterface helper = null, h1 = new HelperB(), h2 = new HelperD();

	for (int i = 0; i < 1000; ++i)
	{
		switch (i / 500)
		{
		// Here, I periodically reassign the helper variable to either HelperB or HelperD,
		// making the call-site below really polymorphic, which kills easy dataflow-based
		// dervirtualization.  Notice also that 50% of all calls will go to each class,
		// so profiling won't let the JIT decide to optimize one case (e.g. helperB) in
		// detriment of the other with a type-check + inlining only for the hot case.
		case 0: helper = h1; break;
		case 1: helper = h2; break;
		}

		for (int j = 0; j < calls; ++j)
			// This is the polymorphic, interface-based, call-site to optimize.
			// The invoked methods perform a trivial operation, but one that
			// cannot be optimized out (it updates a static variable).
			helper.polyHardF(i);
	}
}

From the bugtrack comments, it seems that this fix is not specific to interface calls. It's only an artifact of my benchmark that the limitation of the optimizer was only caught in the MethodHard/Interf test. But since interface-based calls are by far the hardest ones to optimize (due to multiple inheritance), this is good news for complex OO code overall.

How does HotSpot compile this code, in 5.0u8 and Mustang? I looked at the code (using Mustang's debug build and -XX:+PrintOptoAssembly) and saw that it actually inlines both HelperB's and HelperD's implementations of polyHardF(). It's a strong demonstration of several optimizations combined: the compiler must determine that there are only two possible concrete types for the call-site, and that both deserve inlining... and there's more - let's check the code:

# Start of the inner loop: int j = 0...

0d8   B12: #    B13 <- B11  Freq: 15356
0d8     XOR    EBP,EBP
0da

# ...Loop body...

0da   B13: #    B29 B14 <- B12 B18      Loop: B13-B18 stride: not constant  Freq: 30715
0da     MOV    ECX,[ESP + #12]
0de     MOV    EBX,[ECX + #4]
0e1     NullCheck ECX
0e1

# The "payload" code for the inlined methods is here, because both
# implementations of testHardF() are identical = { ++x; } where x is a static int
# (and it's the same x, in a shared superclass).  HotSpot was smart enough to
# merge part of the common code (the read and the increment) and move it up.

0e1   B14: #    B16 B15 <- B13  Freq: 30715
0e1     MOV    ECX,#344
0e6     MOV    EDI,[ECX + precise klass Helper: 0x00a3e2a8:Constant:exact *]
0ec     ADD    EDI,[ESP + #16]

# Guard code: helper instanceof HelperB?

0f0     CMPu   EBX,precise klass HelperB: 0x00a3c3d0:Constant:exact *
0f6     Jne,us B16  P=0.266667 C=-1.000000
0f6

# Inlined code for (the rest of) HelperB.testHardF().

# I don't understand completely the need for this code, but I guess HotSpot
# wants to keep track of stack frames, and/or produce a trap if there is some
# change in the class hierarchy that invalidates the inlining.

0f8   B15: #    B18 <- B14  Freq: 22524.3
0f8     MOV    ECX,[ESP + #12]
0fc     #checkcastPP of ECX
0fc     MOV    [ESP + #12],ECX
100     MOV    EBX,#344

# Here the new value for x is stored -- the read and increment were moved up
# for sharing, but the write must be performed in the right place (I think)
# to not produce illegal behaviors: e.g., if helper is neither HelperB nor HelperD,
# quite possible if it is null (the benchmark code makes difficult to prove the
# never-null property of helper), then a NullPointerException should be raised
# and x should not be updated due to out-of-order code.

105     MOV    [EBX + precise klass Helper: 0x00a3e2a8:Constant:exact *],EDI
10b     JMP,s  B18

# Guard code: helper instanceof HelperD?

10b
10d   B16: #    B26 B17 <- B14  Freq: 8190.66
10d     CMPu   EBX,precise klass HelperD: 0x00a3c438:Constant:exact *
113     Jne,us B26  P=0.000001 C=-1.000000
113

# Inlined code for (the rest of) HelperD.testHardF().
# Same stuff as before.  It's sad that, both methods being exactly identical,
# HotSpot inlines and merges only part of their bodies, but doesn't do it
# neither for this bookkeeping code nor for the store.  Quite likely HS doesn't
# want that, so it doesn't lose the ability to walk stacks precisely, in events
# like GC, OSR, and exception stack-trace filling (don't you hate JVMs that don't
# report exact line numbers for all frames, in compiled code?).

115   B17: #    B18 <- B16  Freq: 8190.65
115     MOV    ECX,[ESP + #12]
119     #checkcastPP of ECX
119     MOV    [ESP + #12],ECX
11d     MOV    EBX,#344
122     MOV    [EBX + precise klass Helper: 0x00a3e2a8:Constant:exact *],EDI
122

# ...End of the inner loop: ++j; go back if j < calls

128   B18: #    B13 B19 <- B15 B17 B27  Freq: 30715
128     INC    EBP
129     CMP    EBP,[ESP + #0]
12c     Jlt,s  B13  P=0.999935 C=15360.000000

That's it. But just so you don't think the optimizer is now perfect, it could be even better, if HS could combine the switch statement with versioning of the inner loop, so the overhead of testing helper's concrete type and branching to the correct inlined code would be reduced to 1/500th, like this:

switch (i / 500)
{
case 0:
	helper = h1;
	for (int j = 0; j < calls; ++j)
		helper.polyHardF(i);
	break;
case 1:
	helper = h2;
	for (int j = 0; j < calls; ++j)
		helper.polyHardF(i);
}

This transformation would even dispense the complex optimizations we just saw, because in the new code, there are two call-sites that are trivially identified as non-polymorphic, so the compiler is free to inline with zero overhead, and also do other tricks like replacing the entire loop by "x += 500", thus delivering a >500X boost (in this case, my microbenchmark would be declared "broken" as such code pattern hardly occurs in real app code). But the above optimization is really, really difficult; there is no optimizer (for Java at least) that can do it. Which allows me to conclude with two of my favorite clichés:
a) There's room for the next major release to be even faster.
b) Human Assembly hackers (with enough time in their hands) will always win.

Enjoy the new JDK's performance. I haven't yet tried it on real-world application benchmarks, but there are other important perf bugfixes, like Bug 6298694: bad performance with big object in heap, probably much more important than my "pet bug" discussed here, because the latter can screw up with concurrent GC performance.



Bloated Mustang?

Posted by opinali on June 22, 2005 at 08:34 AM | Permalink | Comments (15)

Build 40 of Mustang was the first drop with the first significant new API additions. And the inevitable happened as some people started to complain about the addition of "useless" features: who needs Web Services, Javascript or an HTTP server? Why Javascript instead of [put favorite language here]? Some of these features are indeed hard to justify in J2SE, if we miss the big picture.

The first (and the biggest) new API is JAX-WS. The trend of Web Services has definitely chilled out from the overhyping of a few years ago; people are not anymore planning to replace robust and efficient middleware by SOAP without really good reasons. Nevertheless, WS are very important, and interoperability was always one hallmark of the Java platform. Some people even wanted to see basic WS APIs in Tiger, but it was too early by then. Now the WS-I specs are more complete and firmly settled, the implementations of WS-I-compatible runtimes are much better than early 2004. So it was not a surprise for me that fewer people complained about this addition to the core, even though it's the bigger piece of the cake. This bundling is also important for performance reasons. The APIs for XML, SOAP and related technologies are very critical and they can benefit from important features of newer J2SE releases, from java.nio to StringBuilder to java.util.concurrent to whatever comes in Mustang. But non-core APIs (like those in the JWSDP) usually have to keep compatibility with older J2SEs. So let's put at least all critical pieces of XML and WS in the core and optimize them to the max, because the pressure keeps coming.

Let's see the HTML serving feature. I'm frankly appalled with some people who complained about this, without making any connection to the Web Services APIs. Hey folks: SOAP (and the whole WS stack) requires this. And no, Sun didn't include a full Servlet/JSP/WAR container in Mustang. It's only the most basic HTTP protocol service capability, and I don't expect this to be very fat. Alas, I couldn't seem to find this HTTP serving feature in public APIs, so I guess this is internal to the WS packages but I hope it's going to be exposed by some public API... it costs nothing since the implementation is already there, people may want to listen HTTP for some non-SOAP needs, and it's a nice counterpart to the current HTTP capabilities of the java.net package.

Now let's talk about scripting. Many people like scripting languages, but choosing a specific language is a heated debate.  Personally, I don't like these languages; I hate when I have to hack some Javascript (inevitable in Web GUIs) and that's just how far I go with scripting. I am a firm believer in static type checking and other "bureaucratic" features of conventional languages. On the other hand, I'm keen on higher-level language features like closures, purer typesystems, or language-level support for several tasks (collections, markup languages, SQL etc.). Many scripting languages deliver these features. I like what I've seen of Groovy because it's a higher-level Java that I'd enjoy to use in some situations – when I don't need the extra performance of Java's lower-level designs like more static dispatch and primitive types. But I couldn't care less about the scripting side of the language: if they drop the interpreter option or "eval" capabilities, I'll be missing nothing.

Having presented myself as an independent and unbiased judge (not a fan of any of the competing languages), I think Javascript is a good choice if any such language is to be embedded in the J2SE. Javascript may not be the best scripting language available, either in design or features, but it's not bad as a pragmatic choice. Javascript is
  • Very popular. Most developers know it already. Billions of browsers out there support it.
  • Mature and stable for several years (although it's apparently evolving again).
  • Formally standardized by multiple ECMA specs.
  • Familiar to Java programmers, with virtually the same syntax.
  • Very small. Its runtime adds 660Kb (uncompressed) to Mustang.
It is very difficult for any other scripting language to compete with the list above. BeanShell and Pnuts are not popular enough, and as programming languages they don't add anything, only relaxed syntax. Groovy is not even at v1.0, and programming languages are slow to mature. Even if Groovy reached a nice FCS in time for Mustang, I'm 100% against the inclusion of any full-new language in the J2SE. The core Java platform must hold very high standards for stability and compatibility, and you really don't want the integration of a language that's still in a stage of fast evolution, trust me. Languages like Ruby and Python are cool and mature, but their pure Java ports are lagging a lot behind the latest reference implementations. And those more "respectable" languages are bigger – exactly because they are mature languages that try to be useful on their own, so they need a standard library of APIs of reasonable size, and it's these libraries that make the languages big. There is no competition to Javascript, because Javascript doesn't need any APIs – it was designed to piggyback on interfaces exposed by web browsers, like the DOM tree, which serve as the API for scripts living in HTML pages, but are irrelevant outside a browser. This explains why a complete Javascript runtime fits in little over half megabyte. Even Groovy, which is designed to depend on the J2SE APIs, is several times bigger (even after you cut all redundant stuff, like XML parsers and other things that are/will be already bundled by the J2SE).

Not that I am completely happy with Javascript either. For one thing, I think Javascript should be updated with some new goodies of JSR-201 like enhanced-for and varargs. Otherwise, it will be funny that a scripting language may be often more verbose and less productive than its more conventional counterpart, Java.

The real question here is whether we should have any scripting language included in the J2SE. The JSR-223 abstract package, javax.script, is small (~26Kb), but I always wonder if it's a good idea to put in the core an API without a concrete implementation. It smells to vaporware, and slows the adoption of the new API significantly. A good case against bundling is when you can't have a single RI that works for everybody, e.g. for JDBC drivers (and even in that case, there is the bundled JdbcOdbc driver!). In the domain of scripting languages, you can have an implementation that works in all environments, but different users want completely different languages. Well, I don't really know what is the best option here.

I guess that this bundling of Rhino would be more firmly justified if it was useful to other J2SE 6.0 features. Mustang is planned to have some sort of shell utility based on JSR201, that will be great for quick exploration, and integrate with the J2SE's growing serviceability features. This is a great dog-feeding of JSR201 and it demands the bundling of a concrete scripting implementation; but it's a developer-side feature that could be well served by bundling in the J2SDK's tool.jar. Another interesting use of Rhino is found in Cocoon, where Javascript's support for continuations makes possible a programming model that may well be the next big thing in web frameworks. Truly cool stuff, but not a case for J2SE bundling either, since it would be good enough to include Rhino in J2EE 6.0 and future versions of Servlets / JSP / JSF / whatever. We're still missing a killer app for scripting in the JRE. One idea: Swing's aging HTML component might become capable of DHTML behaviors (I'm not much of a client-side developer and I don't know how cool is this idea, perhaps it's good for JavaHelp?). Any other ideas?

Opening Java

Posted by opinali on May 21, 2005 at 08:28 AM | Permalink | Comments (10)

I’ve been a close observer of the evolution of the Java platform, and one of the aspects that attracted me since the beginning was its openness. Back in 1996, the JDK 1.0 bundled source code for all public API classes (378Kb!). It was also multiplatform in respect to OS & hardware platforms, and soon a strong multi-vendor platform. As a binary standard, it succeeded where paper-only or source-level standards failed. Java was a big step forward.

But that was ten years ago, when free / open-source software (FOSS) was also warming up. For example, Eric Raymond’s TCATB would appear only 1+ year later  (May ‘97), and it was visionary at that time. Today, Java is huge, the top business app development platform. Meanwhile, FOSS increased in importance, volume and mindshare by orders of magnitude, and it has also become serious business.

Unfortunately, Java is increasingly seen as a problem in the POV of FOSS users and developers. This is despite many significant improvements in openness since ‘96:

Full source code is available, including Sun’s crown jewels like HotSpot.

The first SCSL releases used to be made available several months late, and updated only for major releases, so only licensees who pay a big fee had full access to up-to-date sources. But now with the Mustang projects, the public sources are updated weekly, so anybody can track its development as closely as for any traditional open source project.

The JCP is an effective forum to drive Java standards in an open way.

It’s less open than projects driven by public forums and more relaxed steering committees (no fees for influential positions, no strong dependency on proprietary software vendors, pure meritocracy, etc.). But every model has its tradeoffs, and not everybody is convinced that a “Pure Open” model would scale to the technical and business realities of J2SE.

The relationship between Sun, the JCP, and other commercial backers of Java, and the FOSS community, is very strong.

The latest version of the JCP’s process (JCP 2.6) certifies that open source groups can implement any JSR, and makes the JSR works more transparent for outsiders. The major Java vendors have strong participation in FOSS projects like those from Apache and Eclipse, not to mention others not directly related to Java, like Linux or OpenSolaris. In fact many JSRs have their Reference Implementations delegated to FOSS projects, historically under the umbrella of Apache Jakarta and more recently in java.net.

Java was always a great player with open standards in general.

Many non-Java developers have the impression that we like to reinvent the wheel, creating our own incarnations of everything. The truth is that we just create new implementations of everything. For example, a Java webserver like Tomcat doesn’t reinvent any wheel or break any standard: it strictly adheres to relevant standards, like HTTP. Somebody could ask why don’t we simply use (and contribute to) an existing free httpd, adding new modules for Java-specific technologies like JSP. But the reason for not doing this is not just the WORA mission. The full vertical integration of the software stack, possible when everything is written in Java and optimized for Java, is advantageous in many fronts, from performance to ease of development and extensibility. The major reasons why other people don’t do the same are that their languages don’t have sufficient performance for systems / middleware programming, or their communities are not big enough to support such projects.

Having said that, Java is not yet true Open Source or true Free Software. Sun’s licenses, SCSL and JRL, don’t grant all rights required by the FOSS communities (Bruno Souza explains this in detail). Sun says they want to avoid a proliferation of dialects of the platform. You may think this is very unlikely because few people will be interested in making changes to the Java language or creating new core APIs. But these are not the only sources of ‘dialectization’. You just have to introduce a new bug, one that would create a JCK failure, and the damage is done: it’s not Java anymore.

How justified is this argument? We can answer this by checking current FOSS Java projects, like Classpath, GCJ and Kaffe. These projects do a pretty good job in respecting Java standards. They don’t add any new public APIs, and their compatibility issues are related to insufficient resources to catch up with the proprietary implementations and to lack of access to the JCK under acceptable terms (this is just fixed with J2SE 5.0). So the community has even started its own free replacement for the JCK, Mauve – a strong evidence of the commitment of the FOSS developers to Java compliance. (But I would be too forgiving to ignore GCJ’s CNI, a proprietary native interface that competes with JNI, and has no reason to exist, except for the immaturity of GCJ. Microsoft also did have good technical excuses for the extensions they created long ago. Dear GCJ developers, please kill this bastard; CNI gives reason to all the paranoids that think opening Java is killing its WORA.)

Java has become too important to be ignored even by those old-school FOSS developers who still love lower-level tools like C. FSF leader Richard Stallman’s Java Trap paper puts this in good perspective. RMS doesn’t seem to be a big fan of Java (“people who write free software often feel Java is sexy…”), but he admits that just not using Java is not an option. The world is now full of Java code and Java programmers, and the only viable solution is having a Free Java implementation. This debate is getting hotter by the day. We recently saw the FSF complaining about the growing use of Java in OpenOffice. I think that if this community didn’t have resources to compete alone in this field, they should be happy that Sun has made OO possible. Of course Sun will put Java wherever it’s a good fit. I was amused by the FSF’s initial reaction, hinting towards a fork of OO to drop, or re-implement in other languages, the pieces that use Java. This is IMHO something that should not happen in a healthy FOSS community – and those who value the Free Software ideology over features could easily pick other choices. Fortunately, it seems that the FSF is going to do the right thing: tweak OO and/or improve GCJ until they work together, so OpenOffice 2.0 offers a 100% Free build for those who care. I am one of those who won’t use that (when OO2 goes FCS, I will certainly run it atop any JVM that deliver the best stability  and performance) so I don’t like the additional delay imposed by this solution. But looking from the Forest view, I think it’s a good thing: OO is not the only software that will benefit from improved Free Java implementations, and these improvements may increase the popularity of Java with Free software users. After all, there is a whole boatload of high-quality Free Java software out there. Any effort spent in converting Java to C for specific apps, even important ones like OO, is wasted effort, in perspective.

The other big news is Apache’s newly-incubated Harmony. Everybody is blogging over Harmony, so I will try to add some new thoughts. Harmony intends to build a complete, compliant J2SE implementation, which is a step forward compared to VM- or library-only projects. They are talking to the FSF over Classpath, because without reusing that, the project is not viable, as the J2SE APIs are too big and fast-moving. I’m very curious about the reaction of some players, like IBM, who has been pushing Sun publicly towards open-sourcing Java. Well, IBM owns at least two completely clean-room, production-quality JVMs (IBM JDK and J9), and it seems they have reimplemented large chunks of the APIs too, especially the most difficult ones like CORBA and Security. AFAIK they can open these sources without breaking contract with Sun. And it’s not just IBM; BEA has also became a competitive player recently with JRockit, and Apple, while not in the clean-room team, has made many significant improvements to HotSpot and APIs like Swing.

But I don’t think this is a simple case of cheap talk. It’s more likely a case of “we’re not giving away our competitive advantage, at least not alone”. For major Java players, having their own proprietary JVM is strategic: to have control over its implementation (e.g. to fix bugs that are important to their own customers), add optimizations for your hardware or application server and vice-versa. This is also the reason why just pledging Sun to unilaterally opensource Java has little chance to work. These companies will not open the code for their Java technology before they sit together and find a common solution, one that doesn’t risk anybody’s business plans. (And Sun must be part of the solution, because nobody else has complete clean-room APIs.) Perhaps the best alternative is endorsing a new, independent Free Java project like Harmony, as those big companies know that such project, even with significant resources, will take several years to start competing with proprietary JVMs, if not in compliance certainly in performance. Then Sun, IBM, BEA and others can play nice, even donating resources and developer time to Harmony, while still boasting their superior proprietary implementations whenever it’s good for business. Some day, a great J2SE implementation will be a commodity, but this day is not today. And if you ask me, there’s nothing wrong with this strategy.

Should a full, top-notch J2SE implementation go Free today, we wouldn’t need Harmony, but then we might worry about potential “misuse” of these sources. The risk of forking has been discussed to death and I don’t think it’s big: the Java community has a strong culture of following its standards, and the current status of Free implementations that are not compliant because they can’t is worse than any purposeful forking. A second possibility is that Java code could be useful for competing platforms. This risk is significant, as .NET is a strong competitor that’s also similar enough to Java to allow easy porting. I don’t think Microsoft would do that, but I wonder about FOSS .NET projects, like Mono or DotGNU. These projects are way behind the proprietary VMs (either Java or .NET); and their developers obviously like .NET better than Java, or perhaps for DotGNU, value their Free agenda more than any of the competing platforms. There are VM projects like RMTk, and library projects like NUnit, providing evidence that Java code can be used to accelerate the production of similar .NET software. Not to mention “hybrid” solutions like IKVM, that allows running unchanged Java code on .NET runtimes. Even if the Java code is eventually replaced by new code, written from scratch to better explore .NET’s style and frameworks, the Java code is very useful for prototyping and to make initial versions available quickly. In an ideal world, both communities could benefit from each other’s work, but in practice, the numbers of Java are still vastly superior to .NET’s, so we’re just giving away and not receiving anything back. Companies with a large investment in Java might worry about giving away technology to the competition. They could use viral licenses like the GPL or CDDL, so the Java code cannot be used in proprietary .NET products that are their main competition, but this won’t prevent that code to foster the opensource .NET offerings. But in the bright side (and now I’m dropping my Java-advocate hat to say this), the migration of code from Java to NET, and eventually vice-versa, is interesting from the interoperability point of view, as we tend to have more compatibility between software of both worlds.

The whole debate is even more interesting when we inspect Sun Microsystem’s overall behavior towards open source. We have to commend Sun not only for past glory like NFS, but for very important, high-profile open source efforts like OpenOffice, NetBeans and OpenSolaris. The latter, btw, is supposed to deliver the promised source code by mid-June. (Solaris X will be very appealing to advanced Java developers as soon as DTrace supports Java.) And the weirdest thing is that in these other opensource efforts, Sun doesn’t have any problem with real FOSS licenses. In OpenSolaris, Sun even adopted a “viral”, MPL-like license, perhaps with the same logic of not helping competitors with proprietary OSes, or even Free ones. And while some people inside Sun are very vocal in favor of open source, James Gosling is not, saying that many customers would “freak.. screaming to the hills” over the prospect of opensourcing Java. I admire James for his brave words, in a time when being anti-opensource is almost politically incorrect – I’m just waiting for the Free zealots comparing JG to Bill Gates due to this quote. I would certainly “freak out” if Sun just opened CVS access to the J2SE project so anybody could check code in. But no serious opensource project works that way, they have layers of leadership and code reviewers to validate contributions; and James knows it, and this didn’t stop Sun from opening Solaris. Check the OpenSolaris roadmap for this, they have planned a process to make external contributions possible without wrecking the quality of the Solaris product. In the Mustang project, even at this stage (without full opensourcing), Sun has also put together the basic process and infra-structure for contributions. I say “basic” because they won’t have a significant volume of contribution before they have a FOSS license, but it’s a solid step towards full opensourcing if this ever happens. Now, with respect to freaking customers, Sun should do some customer education before they opensource Java, just like (I guess) they have/will do for Solaris. It’s just a matter of making clear that the huge engineering and QA effort that was put into J2SE will not be compromised. This implies that, if Sun opensources their implementation of J2SE, they should do that in a way that keeps enough control so they can enforce their standards and vision. Look no further than Eclipse, which organization and process was recently criticized for being less open than other FOSS projects… well, as a satisfied user of Eclipse, I think its governance is ideal like it is, and it seems that OpenSolaris won’t deviate much from that model: Sun will obviously keep a very strong leading position... anyway, Free Java is probably not going to happen that way.

So, what about Harmony? It’s an excellent move from the Free community, probably the best (or only) viable way to produce a Free implementation of J2SE, and then increase even further the penetration of the Java platform. Now, if they have as much success as I wish, and in a few years we have a complete, high-performance Free Java, then we will have real answers to the big questions posed here: whether a “pure” FOSS project can deal with something as complex as a production-quality J2SE platform, and whether any of the FUD against Free Java is justified.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds