The Artima Developer Community
Sponsored Link

Agile Buzz Forum
chewing gum and bailing wire

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
chewing gum and bailing wire Posted: Jan 3, 2005 12:51 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: chewing gum and bailing wire
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Slava Pestov has an early review of the JVM sources (which are now available under Sun's community license). He's not impressed; the JVM is over 3M lines of source code, and there's apparently a lot of duplication in there:

  • Code duplication and copy and paste coding is routine. The HotSpot compiler includes an XML output class, written in C++. There is a regexp implementation in sun.misc, different from java.util.regexp. There's at least a half dozen implementations of UTF8 encoding/decoding in the various C++ and Java layers. There is a huge amount of code, obviously copy/pasted then search and replaced, to handle different primitive types in different situations.
  • The reflection implementation is the lamest one imaginable. When you reflectively access a method or a field, it generates a class on the fly, which calls JVM bytecodes to (non-reflectively) invoke the method. Ever wondered why reflection is 100x slower than direct method calls in Java? This is why.

That last one gave me a chuckle. I think I know what happened here. Cast your mind back to when Sun acquired the HotSpot code (from Animorphic - it was originally created as a fast Smalltalk technology). Now, the things you need to do in Smalltalk to speed things up don't necessarily map that well to Java - the kinds of techniques you use to figure out dynamically typed code are not the same ones you'll use with statically typed code. What do I think happened? Well, Sun didn't put the Self team on the problem, that much is clear. They likely pulled a bunch of C programmers out and told them to "have at it". It was nearly 3 years before the HotSpot technology debuted for Java - I bet that management there followed the time honored "throw more developers at the problem" technique of problem resolution. The kinds of things above are a result of that - I'd guess that a lot of those developers never got anywhere near the HotSpot stuff - they were likely farmed out to areas where "they couldn't do much harm".

I think we see the results 3M LOC later. In contrast, the VisualWorks VM has always had a fairly small, focused team working on it - the makeup of the team has changed over time, but it's always been pretty well focused. The result? A VM that is in the neighborhood of 300K LOC (235K of C code, the rest being C header files). Now, the JVM really isn't solving a fundamentally different problem than the VW VM, so there's no good reason to make it bigger (heck, there are lots of things we plan to remove from our VM and move up to Smalltalk over time). The difference? Sounds like Sun fell victim to the age old Too many Cooks Spoil the Broth problem.

Hat tip to Patrick Logan and Chris Double for the link to this.

Read: chewing gum and bailing wire

Topic: Stability update Previous Topic   Next Topic Topic: Some Christmas scenes

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use