The sample application uses a series of examples to demonstrate the features of WebSphere® Real Time for AIX® on 32-bit POWER® that can be used to improve the real-time characteristics of Java™ programs.
The standard java.util.HashMap that IBM® provides works well for high throughput applications. It also helps with applications that know the maximum size their hash map needs to grow to. For applications that need a hash map that could grow to variable sizes, depending on usage, there is a potential performance problem with the standard hash map. The standard hash map provides good response times for adding new entries into the hash map using the put method. However, when the hash map fills up, a larger backing store must be allocated. This means that the entries in the current backing store must be migrated. If the hash map is large, the time to perform a put could also be large. For example, the operation could take several milliseconds.
WebSphere Real Time for AIX on 32-bit POWER includes a sample real-time hash map. It provides the same functional interface as the standard java.util.HashMap, but enables much more consistent performance for the put method. Instead of creating a backing store and migrating all the entries when the hash map fills up, the sample hash map creates an additional backing store. The new backing store is chained to the other backing stores in the hash map. The chaining initially causes a slight performance reduction while the empty backing store is allocated and chained to the other backing stores. Once the backing hash map is updated, it is faster than having to migrate all the entries. A disadvantage of the real-time hash map is that the get, put and remove operations are slightly slower. The operations are slower because each look-up must to proceed through a set of backing hash maps instead of just one.
-Xbootclasspath/p:$WRT_ROOT/demo/realtime/RTHashMap.jarThe source and class files for the real-time hash map implementation are included in the demo/realtime/RTHashMap.jar file. In addition, a real time java.util.LinkedHashMap and java.util.HashSet implementation are also provided.