JWARS Performance Tuning, Donald McQueen
JWARS is a military simulation tool written in VAST, used by the DoD to run scenarios, e.g. if half my satellites are lost, how many aircraft will complete their missions. Donald has described JWARS at past conferences. This talk reviews their performance experience.
Setting OldSpace to the maximum they needed halved their overall time required. This is worth doing on a packaged images as well; it reduced a sub-detected-by-sonar run from 4 hours to 21 minutes.
They used GDK from OTI but without the internal cache and transaction support. They also use packaged images and Oracle. Server Smalltalk has a limit of 64k for object transfer; they increased that to 8Mb. All scenario data is stored as BLOBs. They found Abt was caching the last 10 SQL requests but not reusing buffers when retrieving BLOBs; they halted caching of blob retrieves and arranged creation and reuse of adequately-sized buffers. (10 megabyte BLOBs degraded the object dumper a lot.)
Early on, Smalltalk was 10 times slower than C/C++ at floating point, so they looked at wrapping floating point calculations but found they were not frequent enough to justify it. JWARS incorporates some validated C code for global terrain and coordinate systems, and for distributions. They did these as platform functions at first, then reimplemented them as primitives and they were much faster.
Donald showed a simulation of their 'Iraq 2010' scenario which (as he remarked :-)) had been 'overtaken by events'. Red forces seemed to flight more effectively than Saddam's did in reality and sent a force to invade Kuwait leading to a major battle. They model behaviour (concern for casualties, aggressiveness, etc.) and doctrine (e.g. soviet tank doctrine differed from western).
He ended by describing a few of the comical teething troubles they had in JWARS early days.
- A tank transporter was ordered to stay 30km in rear of HQ. When the HQ retreated, the transporter moved into enemy territory to stay in 'rear' of where its HQ was now facing. When the tank transporter reported seeing a Scud launch, they realised it was closer to the enemy than tank transporters are supposed to be.
The first cut of the satellite code reused the aeroplane code to 'fly' the satellite, so satellites were requesting permission to take off from airports before they would orbit. Likewise, their first cruise missiles flew to target - and then flew back to launch point again.
Q. RDB issues; did you consider using GemStone? GemStone did not handle all required platforms and (so Donald was told; he was not there when this part of the project was being set up) were not too responsive to suggestions that they expand to cover the remaining ones. Technically, he would far rather have used an OODB.
Q. How has your success affected DoD willingness to use Smalltalk? DoD is a big place and we still sometimes get asked, "When will you rewrite this in Java?" Our collaborator, CACI, are now readier to propose Smalltalk work in government contracts but it still has low overall visibility.