вторник, 16 августа 2011 г.

Linux - Java collections. Part 3 (Strings)

Java Collections Framework (JCF) Sun JDK 1.6.0_26-b03
Map<String, Integer> t = new HashMap <String, Integer> ();

Trove 3.0.0rc2
TObjectIntHashMap<String> t = new TObjectIntHashMap<String> ();
Javolution 5.5.1
LocalMap<String, Integer> t = new LocalMap<String, Integer>();
 
PCJ 1.2
PcjOpen
ObjectKeyIntOpenHashMap t = new ObjectKeyIntOpenHashMap ();
 
PcjChained
ObjectKeyIntChainedHashMap t = new ObjectKeyIntChainedHashMap ();

Fastutil 6.3
Object2IntOpenHashMap<String> t = new Object2IntOpenHashMap<String> ();

Guava r09 (Google collections)
HashMultimap<String, Integer> t = HashMultimap.create();



for (0 -> 5)
 test (0 -> 1 000 000)


JCF Trove Javolution PcjOpen PcjChained Fastutil Guava
Fill. Memory (bytes) 95,766,248 74,700,912 119,994,080 73,836,088 79,929,352 67,023,168 263,495,864

4,495,904 87,684,944 6,991,040 80,984,832 3,544,472 76,579,648 -162,304

212,184 87,638,824 -9,726,696 77,590,536 87,404,224 85,331,016 -1,777,656

10,671,208 90,936,584 116,867,384 77,515,544 89,237,992 78,673,248 4,389,152

-835,936 94,381,088 115,282,624 73,853,216 83,641,384 81,312,768 -1,836,048
Fill. Time (ms) 1318 1040 1539 1,163 1,490 752 3758

977 488 1666 704 1,684 1,571 2153

763 706 1931 625 514 1,095 1442

697 948 1177 580 486 1,082 2029

611 658 1140 487 423 1,217 1968
Read. Memory (bytes) 677,112 -92,629,472 -119,093,880 7,723,768 2,556,232 2,188,368 52,114,488

4,923,056 3,340,016 6,648,064 -484,248 10,599,232 181,472 -8,701,752

2,324,160 -449,560 -8,174,144 -5,060,160 7,735,448 1,380,576 -40,779,200

-578,280 -2,744,576 1,444,872 9,850,896 -16,424,696 6,141,472 46,943,040

-1,811,088 5,497,288 294,408 7,864,248 2,918,000 -3,985,776 48,890,808
Read. Memory (ms) 231 670 1202 222 207 716 203

135 102 233 186 119 585 270

137 106 230 185 112 672 264

134 108 226 173 117 633 186

141 130 226 174 112 633 186

Комментариев нет:

Отправить комментарий