magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1996 > 12 > Java Alley  

How Garbage Collection can Increase Speed

By Bruce Eckel

In the October issue of WT, I spent most of my column explaining why Java couldn't possibly be as fast or faster than C++. Recently, while speaking at the Visual J++ Developer's Conference in Europe, I met Ian Ellison-Taylor, a developer from Microsoft's Java-development team, and Mike Toutonghi, who wrote significant parts of the Microsoft JVM. They patiently explained how Microsoft had implemented Java, and I began to see that much of my perspective stemmed from Sun's inefficient implementation, so there was no model to show how fast Java can be. All I had heard was Sun, saying "Java can be really great," and that wears thin after a while.

Part of my misunderstanding came from being cloistered with the C++ model for too long. C++ is focused on everything happening statically, at compile time, so that the runtime image of the program is very small and fast. C++ is also based heavily on the C model, primarily for backward compatibility, but sometimes simply because it worked a particular way in C so it was the easiest approach in C++. One of the most important cases is the way memory is managed in C and C++ this has to do with one of my more fundamental assertions about Java's slow speed: In Java, all objects must be created on the heap.

Allocating Objects

In C++, creating objects on the stack is fast because when you enter a particular scope the stack pointer is moved down once to allocate storage for all the stack-based objects created in that scope.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2