170 likes | 272 Vues
Learn how to optimize Java applications for high performance control systems. Understand Java's peculiarities and uncover strategies like object pooling, buffering, and more. Explore powerful APIs, synoptic viewers, and alarm tables. Discover the benefits of optimized Abeans framework and network tasks in Java. Evaluate HotSpot VM for optimal performance.
E N D
HIGH PERFORMANCE CONTROL APPLICATIONSWITH JAVA Matej Sekoranja, Mark Plesko J. Stefan Institute, Slovenia, e-mail: matej.sekoranja@ijs.si,http://kgb.ijs.si/KGB Marcel Grunder Paul Scherrer Institute, Switzerland, e-mail: marcel.grunder@psi.ch
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’ Result completely flicker-free drawing Powerful Java APIs make programming easier that ever!
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 Using already optimized Abeans framework Java is able to run multi-connection, multi-threaded & event-enabled applications!
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!
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