HPPC: 高性能的Java原生集合实现
jopen
12年前
HPPC提供了经典Java集合的高性能实现。支持所有原生类似比如:lists, sets 和maps等。专为高性能和高存储效率优化。
final IntCharOpenHashMap map = prepare(10); // For the fastest iteration, you can access the sets's data buffers directly. final int [] keys = map.keys; final char [] values = map.values; final boolean [] states = map.allocated; // Note that the loop is bounded by states.length, not keys.length. This // can make the code faster due to range check elimination // (http://wikis.sun.com/display/HotSpotInternals/RangeCheckElimination). for (int i = 0; i < states.length; i++) { if (states[i]) { System.out.println(keys[i] + " -> " + values[i]); } }