Read Digital Edition


ADS BY GOOGLE
Top Three Links You Must Click On


Maximizing Java Performance with Bespoke Programming
When automatic optimization, code analysis, and dynamic recompilation don't work

Commercial systems are developed with a huge range of performance requirements and we are concerned in this article with the small number of systems where absolute maximum performance is demanded either in terms of execution speed or available memory. We'll discuss the role of bespoke implementation and show that writing programs that utilize novel data structures and new algorithms designed with knowledge of the specific problem context is a necessary complement to the generic components and automatic optimizations offered by compilers and modern JVMs to maximize performance.

Empirical Tests
We'll demonstrate this thesis here with an empirical comparison of the standard Java sort routines working with integers and bespoke implementations optimized to handle integers in specific contexts. Graphs comparing the speed of these algorithms will be presented.

All the empirical tests described in this article were run several times and an average taken, so we eliminate any random variations introduced by unexpected operating system activity. These tests were run on an isolated system, with no other users or applications operating, to minimize skewing the results. The results are output directly by the benchmark programs to file, outside the timed code section, and the results are correlated by an automatic graphing program to remove the possibility of human error. The correlation program also checks that every average calculated for each point on the graphs is calculated from the same number of underlying samples, reports the standard deviation, and identifies any outliers. These are either ignored because they are not significant or the entire benchmark can be rerun.

Efficient Code
The central proposal here is not new or controversial and has been clearly communicated in computing literature for many years that as a rule the fewer instructions a program executes the faster it runs. This is generally true of programs written in any language and is therefore also true of programs written in Java and C++, both common language choices for large, scalable, fast, distributed systems.

Pragmatically this requires hand-crafted code written in a general programming language such as Java or C++ that accounts for a specific programming context to successfully implement the fastest, most memory-efficient programs. In contrast, relying solely on configuring generic components, designed and implemented without knowing the specific circumstances of their use, whether these be off-the-shelf libraries or the automatic optimization of compilers, even with advances in JVM technology, might be sufficient in many circumstances but may not necessarily be optimal. Ultimately, bespoke design, implementation, and optimization, and the creative skill of the programmer used to complement these generic components, will produce the fastest, most scalable programs.

About Adrian Marriott
Adrian Marriott is principal consultant at Progress Software focused on DataXtend and ObjectStore. He has 15 years of industrial experience implementing large, fast, distributed, object-oriented systems using the C++, Java and LISP languages. Adrian has a BA in philosophy from Warwick University and an MSc in artificial intelligence and computer programming from Southbank Polytechnic in London.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

It is evident that the results are output directly by the benchmark programs to file, outside the timed code section, and the results are correlated by an automatic graphing program to remove the possibility of human error.
Web design agency

It is a great step in programming that the tests were run on an isolated system, with no other users or applications operating, to minimize skewing the results.
Programming Assignment


  Subscribe to our RSS feeds now and receive the next article instantly!
In It? Reprint It! Contact advertising(at)sys-con.com to order your reprints!
Subscribe to the World's Most Powerful Newsletters

ADS BY GOOGLE
InformationWeek stumbled on a Microsoft patent application dating back to 2006 deceptively titled “M...
Berlin-based ThinPrint AG, the printer virtualization house, thinks it’s got a cloud solution for th...
The second set of charges filed last week against Indian outsourcer Satyam Computer Services founder...
IBM has acquired Guardium, a seven-year-old subsidiary of Israel’s Log-On Software transplanted to M...
But on the web, access to services is implicit in the fact that the business is offering the service...
Gartner told Reuters that it overestimated how many PCs Acer shipped in the last seven quarters by a...
Oracle has offered to cordon off MySQL inside a combined Oracle-Sun to get the European Commission t...
Intel has put out its promised beta SDK for Windows (C and C++) and Moblin (C) developers working on...
Behaving like it’s got a future, Sun Monday put out what it calls a significant new version of Virtu...
Gartner is buying ~$40 million-a-year AMR Research Inc for close to $64 million in cash. AMD special...
Singed by user reaction to its plans to up the price of its support contracts, SAP Tuesday postponed...
Apparently Google Gears ain’t gonna stick around that long. Google Apps will eventually get their of...
Gartner thinks the server business has stopped sliding into the abyss. Third-quarter sales weren’t a...
Office Web Apps, Microsoft’s answer to Google Apps, are supposed to be out sometime in June along wi...
Oracle seems to have divided the open source ranks over the MySQL delay it’s having closing its acqu...
The Korean government is going to sink around $172 million into cloud computing next year under a st...
We hear – well, you know how people talk – that Oracle has been quietly meeting with the European Co...
In response to Opera’s complaints Microsoft has reportedly modified the proposed ballot screen that’...
CA is looking for talent in EMEA: associate account managers, directors of solution sales, senior so...
Microsoft has sold the Folio and NXT businesses it got when it bought Fast Search and Transfer, the ...