@Benchmark public ObjObjMap<String, String> koloboke() { int localSize = this.size; String[] localElements = this.elements; ObjObjMap<String, String> koloboke = this.isPresized ? HashObjObjMaps.newMutableMap(localSize) : HashObjObjMaps.newMutableMap(); for (int i = 0; i < localSize; i++) { koloboke.put(localElements[i], "dummy"); } return koloboke; } }
@Benchmark public void kolobokeRemove() { for (int j = 0; j < LOOP_COUNT; j++) { IntIntMap newMap = HashIntIntMaps.newMutableMap(this.intIntKoloboke); for (int i = 0; i < KEY_COUNT; i++) { newMap.remove(this.kolobokeIntKeysForMap[i]); } if (newMap.size() != 0) { throw new AssertionError("size is " + newMap.size()); } } }
@Benchmark public void kolobokeRemove() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(this.longLongKoloboke); for (int i = 0; i < KEY_COUNT; i++) { newMap.remove(this.kolobokeLongKeysForMap[i]); } if (newMap.size() != 0) { throw new AssertionError("size is " + newMap.size()); } } }
/** * Constructs a new empty updatable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashFloatCharMapFactory#newUpdatableMap() newUpdatableMap()}. * * @return a new empty updatable map */ @Nonnull public static HashFloatCharMap newUpdatableMap() { return getDefaultFactory().newUpdatableMap(); }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashShortByteMapFactory#newMutableMap() newMutableMap()}. * * @return a new empty mutable map */ @Nonnull public static HashShortByteMap newMutableMap() { return getDefaultFactory().newMutableMap(); }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashShortIntMapFactory#newMutableMap() newMutableMap()}. * * @return a new empty mutable map */ @Nonnull public static HashShortIntMap newMutableMap() { return getDefaultFactory().newMutableMap(); }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntShortMapFactory#newMutableMap() newMutableMap()}. * * @return a new empty mutable map */ @Nonnull public static HashIntShortMap newMutableMap() { return getDefaultFactory().newMutableMap(); }
/** * Constructs a new empty updatable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongByteMapFactory#newUpdatableMap() newUpdatableMap()}. * * @return a new empty updatable map */ @Nonnull public static HashLongByteMap newUpdatableMap() { return getDefaultFactory().newUpdatableMap(); }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashLongIntMapFactory#newMutableMap() newMutableMap()}. * * @return a new empty mutable map */ @Nonnull public static HashLongIntMap newMutableMap() { return getDefaultFactory().newMutableMap(); }
@Benchmark public void kolobokePut() { for (int j = 0; j < LOOP_COUNT; j++) { IntIntMap newMap = HashIntIntMaps.newMutableMap(MAP_SIZE); for (int i = 0; i < KEY_COUNT; i++) { newMap.put(this.kolobokeIntKeysForMap[i], 4); } if (newMap.size() != KEY_COUNT) { throw new AssertionError("size is " + newMap.size()); } } }
@Benchmark public void kolobokePut() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(MAP_SIZE); for (int i = 0; i < KEY_COUNT; i++) { newMap.put(this.kolobokeLongKeysForMap[i], 4); } if (newMap.size() != KEY_COUNT) { throw new AssertionError("size is " + newMap.size()); } } }
@Setup public void setUp() { Random random = new Random(123456789012345L); this.elements = new String[this.size]; this.kolobokeMap = HashObjObjMaps.newMutableMap(this.size); for (int i = 0; i < this.size; i++) { String element = RandomStringUtils.random(RANDOM_COUNT, 0, 0, false, true, null, random); this.elements[i] = element; this.kolobokeMap.put(element, "dummy"); } }
@Benchmark public void kolobokePut() { for (int j = 0; j < LOOP_COUNT; j++) { IntIntMap newMap = HashIntIntMaps.newMutableMap(MAP_SIZE); for (int i = 0; i < KEY_COUNT; i++) { newMap.put(this.kolobokeIntKeysForMap[i], 4); } if (newMap.size() != KEY_COUNT) { throw new AssertionError("size is " + newMap.size()); } } }
@Benchmark public void kolobokeRemove() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(this.longLongKoloboke); for (int i = 0; i < KEY_COUNT; i++) { newMap.remove(this.kolobokeLongKeysForMap[i]); } if (newMap.size() != 0) { throw new AssertionError("size is " + newMap.size()); } } }
@Benchmark public void kolobokeRemove() { for (int j = 0; j < LOOP_COUNT; j++) { IntIntMap newMap = HashIntIntMaps.newMutableMap(this.intIntKoloboke); for (int i = 0; i < KEY_COUNT; i++) { newMap.remove(this.kolobokeIntKeysForMap[i]); } if (newMap.size() != 0) { throw new AssertionError("size is " + newMap.size()); } } }
@Benchmark public void kolobokePut() { for (int j = 0; j < LOOP_COUNT; j++) { LongLongMap newMap = HashLongLongMaps.newMutableMap(MAP_SIZE); for (int i = 0; i < KEY_COUNT; i++) { newMap.put(this.kolobokeLongKeysForMap[i], 4); } if (newMap.size() != KEY_COUNT) { throw new AssertionError("size is " + newMap.size()); } } }
@Setup public void setUp() { this.intIntKoloboke = HashIntIntMaps.newMutableMap(MAP_SIZE); this.intIntGsc = new IntIntHashMap(MAP_SIZE); this.integerIntegerJdk = new HashMap<>(MAP_SIZE); Random random = new Random(0x123456789ABCDL); int[] randomNumbersForMap = this.getRandomKeys(random).toArray(); int number = 23; int lower = Integer.MIN_VALUE; int upper = Integer.MAX_VALUE; this.kolobokeIntKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getKolobokeArray(number, lower, upper, random); this.gscIntKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getGSCArray(number, lower, upper, random); this.jdkIntKeysForMap = this.fullyRandom ? IntIntMapLargeStressTest.boxIntArray(randomNumbersForMap) : this.getJDKArray(lower, upper, random); for (int i = 0; i < KEY_COUNT; i++) { this.intIntKoloboke.put(this.kolobokeIntKeysForMap[i], 5); this.intIntGsc.put(this.gscIntKeysForMap[i], 5); this.integerIntegerJdk.put(this.jdkIntKeysForMap[i], 5); } this.shuffle(this.gscIntKeysForMap, random); this.shuffle(this.kolobokeIntKeysForMap, random); this.shuffle(this.jdkIntKeysForMap, random); }
@Setup public void setUp() { this.longLongKoloboke = HashLongLongMaps.newMutableMap(MAP_SIZE); this.longLongGsc = new LongLongHashMap(MAP_SIZE); Random random = new Random(0x123456789ABCDL); int number = 23; int lower = Integer.MIN_VALUE; int upper = Integer.MAX_VALUE; long[] randomNumbersForMap = this.getRandomKeys(random).toArray(); this.gscLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getGSCArray(number, lower, upper, random); this.kolobokeLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getKolobokeArray(number, lower, upper, random); for (int i = 0; i < KEY_COUNT; i++) { this.longLongKoloboke.put(this.kolobokeLongKeysForMap[i], 5); this.longLongGsc.put(this.gscLongKeysForMap[i], 5); } this.shuffle(this.gscLongKeysForMap, random); this.shuffle(this.kolobokeLongKeysForMap, random); }
@Setup public void setUp() { this.intIntKoloboke = HashIntIntMaps.newMutableMap(MAP_SIZE); this.intIntGsc = new IntIntHashMap(MAP_SIZE); this.integerIntegerJdk = new HashMap<>(MAP_SIZE); Random random = new Random(0x123456789ABCDL); int[] randomNumbersForMap = this.getRandomKeys(random).toArray(); int number = 23; int lower = Integer.MIN_VALUE; int upper = Integer.MAX_VALUE; this.kolobokeIntKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getKolobokeArray(number, lower, upper, random); this.gscIntKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getGSCArray(number, lower, upper, random); this.jdkIntKeysForMap = this.fullyRandom ? IntIntMapSmallStressTest.boxIntArray(randomNumbersForMap) : this.getJDKArray(lower, upper, random); for (int i = 0; i < KEY_COUNT; i++) { this.intIntKoloboke.put(this.kolobokeIntKeysForMap[i], 5); this.intIntGsc.put(this.gscIntKeysForMap[i], 5); this.integerIntegerJdk.put(this.jdkIntKeysForMap[i], 5); } this.shuffle(this.gscIntKeysForMap, random); this.shuffle(this.kolobokeIntKeysForMap, random); this.shuffle(this.jdkIntKeysForMap, random); }
@Setup public void setUp() { this.longLongKoloboke = HashLongLongMaps.newMutableMap(MAP_SIZE); this.longLongGsc = new LongLongHashMap(MAP_SIZE); Random random = new Random(0x123456789ABCDL); int number = 23; int lower = Integer.MIN_VALUE; int upper = Integer.MAX_VALUE; long[] randomNumbersForMap = this.getRandomKeys(random).toArray(); this.gscLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getGSCArray(number, lower, upper, random); this.kolobokeLongKeysForMap = this.fullyRandom ? randomNumbersForMap : this.getKolobokeArray(number, lower, upper, random); for (int i = 0; i < KEY_COUNT; i++) { this.longLongKoloboke.put(this.kolobokeLongKeysForMap[i], 5); this.longLongGsc.put(this.gscLongKeysForMap[i], 5); } this.shuffle(this.gscLongKeysForMap, random); this.shuffle(this.kolobokeLongKeysForMap, random); }