• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

21. Java > Performance Problems Intrinsic to Java

Performance Problems Intrinsic to Java

So why is Java so slow? Let’s take a closer look.

Array Bounds Checking

Java checks the bounds of every array on every access at runtime. Many runtime errors are smoothly handled by array bounds checking, but this necessarily adds time to the execution of your program, because doing something takes longer than not doing it. This is especially noticeable in tight loops. Bounds checking is a welcome relief to many programmers used to C/C++, where a single bad array reference can crash your program.

Blocking Network I/O

Until recently, there has been nothing in Java like the Unix select( ) or poll( ) system calls, which can be used to tell when a socket has data ready for reading by the program. In Java, simply try to


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint