Показаны сообщения с ярлыком fastutil. Показать все сообщения
Показаны сообщения с ярлыком fastutil. Показать все сообщения

вторник, 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

Linux - Java collections. Part 2

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

Colt 1.2.0
OpenIntIntHashMap t = new OpenIntIntHashMap ();
Trove 3.0.0rc2
TIntIntHashMap t = new TIntIntHashMap ();
Javolution 5.5.1
LocalMap<Integer, Integer> t = new LocalMap<Integer, Integer>();
 
PCJ 1.2
PcjOpen
IntKeyIntOpenHashMap t = new IntKeyIntOpenHashMap ();
 
PcjChained
IntKeyIntChainedHashMap t = new IntKeyIntChainedHashMap ();

Fastutil 6.3
Int2IntOpenHashMap t = new Int2IntOpenHashMap ();

Apache Commons Primitives 1.0
IntList t = new ListIntList (new Vector<Integer> ());

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



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




JCF Colt Trove Javolution PcjOpen PcjChained Fastutil ACP Guava
Fill. Memory (bytes) 68,133,064 63,119,136 57,653,184 74,772,216 33,933,528 39,020,016 37,999,296 26,553,808 226,627,248

6,411,112 58,223,272 14,828,016 11,995,648 33,712,256 38,989,184 37,758,872 26,676,816 226,302,584

77,204,400 58,095,344 57,642,776 74,997,784 33,779,120 39,169,968 37,758,240 26,490,848 5,289,464

72,908,792 58,040,176 57,651,312 75,625,976 33,683,784 39,063,032 37,756,144 26,589,328 5,090,992

64,801,408 58,011,088 59,269,992 77,353,624 33,678,696 39,094,520 37,763,552 26,741,248 -3,922,144
Fill. Time (ms) 376 138 132 420 96 80 152 39 2290

447 101 390 648 61 50 113 21 1852

365 108 79 337 65 58 117 32 2006

261 103 86 320 70 54 123 34 1949

285 105 66 308 66 47 125 24 2146
Read. Memory (bytes) 151,968 0 0 2,345,264 0 0 0 0 21,900,936

16,184,736 0 0 16,123,520 0 0 0 0 16,060,616

-10,861,736 0 0 16,123,520 0 0 0 0 14,859,024

15,874,584 0 0 -26,366,816 0 0 0 0 -36,395,848

-10,601,616 0 0 15,638,976 0 0 0 0 16,622,760
Read. Time (ms) 166 23 15 184 20 12 46 20 106

25 10 7 168 6 5 38 7 80

147 9 7 97 6 5 36 7 82

21 9 7 239 5 5 36 7 151

154 9 7 95 6 5 35 8 86

среда, 27 июля 2011 г.

Linux - Java Collections Framework

Java Collections Framework vs Colt vs Trove vs PCJ vs Fastutil

Java Collections Framework
Map<Integer, Integer> t = new HashMap <Integer, Integer> ();

Colt 1.2.0
OpenIntIntHashMap t = new OpenIntIntHashMap ();

Trove 3.0.0rc2
TIntIntHashMap t = new TIntIntHashMap ();

PCJ 1.2
IntKeyIntOpenHashMap t = new IntKeyIntOpenHashMap ();


Fastutil 6.3
Int2IntOpenHashMap t = new Int2IntOpenHashMap ();


Кол-во тестов: 5
Цикл: 10000000

Результаты в миллисекундах
Заполнение
JCFColtTrovePCJFastutil
1162711758817841688
903112539507221734
788212528817141675
10463100810357241703
4581106510406111780

Чтение
JCFColtTrovePCJFastutil
21161197669907
4435966357888
2052937156898
3889917056903
2131927155962

JCF
Colt

Trove
PCJ
Fastutil