[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Speed in Languages and Browser Architectures

  • From: Elliotte Harold <elharo@m...>
  • To: Rick Marshall <rjm@z...>
  • Date: Fri, 02 Mar 2007 07:34:38 -0500

Re:  Speed in Languages and Browser Architectures
Rick Marshall wrote:

> The implication is that Java can create a sequence of instructions that 
> C can't.

Essentially it can. Runtime (JIT) optimizers know things static 
optimizers don't. They can sometimes tell that a particular code path 
will not be taken or that an object has a certain type or other useful 
information that is simply not known to the static, compile-time 
optimizer. They can sometimes use such information to run even more quickly.

The nature of the languages also plays a part. Pointer aliasing is a big 
problem for C and C++ optimizers. It's a reason Fortran outperforms C, 
even with the same compiler. Java doesn't have C-style pointers so it's 
more like Fortran in that regard.

And of course manual memory allocation is almost always slower and less 
reliable than a good garbage collection library. You can use a garbage 
collection library for C/C++, but few programmers do in practice.

Together these are enough to push Java a couple of percentage points 
ahead of C on some problems. Not all problems, certainly, but enough of 
them that you can't just naively assert that C must be faster than Java. 
  That may have been true in 1997. Today it demonstrably isn't.


-- 
Elliotte Rusty Harold  elharo@m...
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.