-------------------------------- GNU Trove Benchmark suite -------------------------------- java.vm.name=Java HotSpot(TM) Client VM java.runtime.version=1.5.0_06-103 os.name=Mac OS X os.arch=ppc os.version=10.4.8 -------------------------------- compares 100000 Set.contains() operations. 3 are actually present in set Iterations: 25 Their total (msec): 794 Our total (msec): 1552 Their average (msec): 31 Our average (msec): 62 -------------------------------- sums a 100000 element Set of Integer objects. Their approach uses Iterator.hasNext()/next(); ours uses THashSet.forEach(TObjectProcedure) Iterations: 25 Their total (msec): 759 Our total (msec): 120 Their average (msec): 30 Our average (msec): 4 -------------------------------- compares Iterator.hasNext()/ Iterator.next() over 100000 keys Iterations: 25 Their total (msec): 219 Our total (msec): 250 Their average (msec): 8 Our average (msec): 10 -------------------------------- compares Iterator.next() over 100000 map keys Iterations: 25 Their total (msec): 229 Our total (msec): 126 Their average (msec): 9 Our average (msec): 5 -------------------------------- compares 100000 LinkedList.add() operations Iterations: 25 Their total (msec): 1049 Our total (msec): 296 Their average (msec): 41 Our average (msec): 11 -------------------------------- 100000 entry primitive int map.put timing run; no basis for comparison Iterations: 25 Their total (msec): 0 Our total (msec): 310 Their average (msec): 0 Our average (msec): 12 -------------------------------- compares 100000 Map.put() operations Iterations: 25 Their total (msec): 3545 Our total (msec): 823 Their average (msec): 141 Our average (msec): 32 -------------------------------- compares 20000 Set.contains() operations Iterations: 25 Their total (msec): 252 Our total (msec): 69 Their average (msec): 10 Our average (msec): 2 -------------------------------- compares 100000 Set.add() operations Iterations: 25 Their total (msec): 3556 Our total (msec): 530 Their average (msec): 142 Our average (msec): 21 -------------------------------- done
Memory
-------------------------- Compare size of Set implementation: 1,000 Integer objects measured in bytes javasoft: 48249 trove: 28864 trove's collection requires 59% of the memory needed by javasoft's collection -------------------------- Compare size of LinkedList implementation: 1,000 TLinkableAdaptor objects measured in bytes javasoft: 40048 trove: 16024 trove's collection requires 40% of the memory needed by javasoft's collection -------------------------- Compare size of int/IntegerArrayList implementation: 1,000 ints measured in bytes javasoft: 20040 trove: 4032 trove's collection requires 20% of the memory needed by javasoft's collection -------------------------- Compare size of Map implementation: 1,000 Integer->Integer mappings measured in bytes javasoft: 48248 trove: 41696 trove's collection requires 86% of the memory needed by javasoft's collection