HPPC: 高性能的Java原生集合實現

jopen 11年前發布 | 19K 次閱讀 HPPC Java開發

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]); } }</pre>

項目主頁:http://www.baiduhome.net/lib/view/home/1362101377085

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!