Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Just JAVA book - Performance questions

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, peter, as author point of you, how's the performance of tiger as compare java1.4 ?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My opinion - Java Tiger has some features which impact performance for e.g. autoboxing.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
My opinion - Java Tiger has some features which impact performance for e.g. autoboxing.


Only if you don't understand how it works. If you use it wisely, it is "just" syntactic sugar for code that otherwise you had to code manually, anyway.
 
Peter van der Linden
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alvin,
Good to hear from you with that great question. And hello to Pradeep, who points out that
some new features (primarily auto-boxing/unboxing) take cycles at run time.

As people may know, boxing is a convenience feature that automatically converts
between a primitive type (like int) and its corresponding wrapper type (java.lang.Integer)
when the context demands it. It is there to make it easier and quicker to write code like:

Instead of l.add( new Integer(36) );

But those wrapping operations don't go away just because the programmer doesn't have to
write them any longer. The compiler actually inserts them implicitly for you. So it costs the
same as before, but you just don't see it.

How much does it cost? I have a small section devoted to that on p56 called "Performance
Implications of AutoBoxing".

Now, looking at the other side of the equation, there have been some stunning improvements
in desktop speed introduced with Java 5. I am thinking here of class data sharing. This
technique was originally developed by Apple for their Java compiler (and have you noticed how
much innovation of all kinds takes place in Apple? Keep your eye on *that* ball!).

This technique maps most of the run time library into the JVM as a single memory image
rather than a series of loads of class files. Memory mapped I/O is the fastest kind of I/O there
is, but it is not widely used outside systems programmers, probably because a lot of
application programmers are not yet familiar with the API. This technique (memory mapped
IO for the run time library) doesn't take any work on the part of application programmers
but we will all see the benefit with faster Java start-up times.

I am very anxious to see the benchmarks for the final version of Java 5, shipping tomorrow
if all goes well. I think we will see some real speed-ups for desktop apps. I use that excellent
Karsten Lentzsch Java freeware JDiskReport ALL the time. You can find it at:
http://www.jgoodies.com/index.html

That is quality software written by a real Java expert. It will be interesting to see how
the performance improves with Java 5!

Cheers,

Peter
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have test on JDiskReport, it really fast ~~ superb JAVA
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic