HIGH PERFORMANCE CONTROL APPLICATIONS WITH
JAVA
Matej Sekoranja, Mark PleskoJ. Stefan Institute, Slovenia, e-mail: [email protected], http://kgb.ijs.si/KGB
Marcel GrunderPaul Scherrer Institute, Switzerland, e-mail: [email protected]
Times have changed…
1996 2000
Java is state-of-the-art language
Object-oriented Portable Multi-threaded Garbage collected Dynamically loaded Exception-handling Powerful API
… but Java can be slow, too! Arrays are objects Runtime checks (nulls, bounds, types) Precise exception semantics Small methods, frequent calls (OO
programming) Synchronization costs Dynamic allocation, garbage collection Accessing system interface
Avoid these peculiarities!
Let’s optimize!
… Object pooling Buffering & pre-buffering … and many more
Synoptic viewer Displays CS of the Swiss Light Source CDEV-EPICS communication (JNI used) Graphics performance – problem !?
Double buffering – not enough! Additional buffer added – ‘triple buffering’
Powerful Java APIs make programming easier that ever!
Result completely flicker-free drawing
Alarm table Monitors properties of all devices & reports
possible alarm states (alarm = CORBA triggered event)
Approx. 1200 CORBA connections (whole CS of ANKA)
Goal: no blocking at critical situations! Threads, buffering & pre-buffering, filters
Java is able to run multi-connection, multi-threaded & event-enabled applications!
Using already optimized Abeans framework
Snapshot Archiving client SQL DB access
JDBC used 100% pure Java & native protocol driver
Buffered transfer (usage of prepared SQL statements)
Result archiving (retrieving & transferring data) whole ANKA CS takes approx. 3s (with normal CS network traffic)
Java is capable to do network tasks!
Conclusion
Which Java VM to choose?
HotSpot VM
On-the-fly "adaptive" compilation
Method in-lining Improved and
redesigned object layout
Fast and fully accurate garbage collection
Ultra-fast thread synchronization
HotSpot performance
Numerical benchmark
Network performance & scalability benchmark
Memory usage