Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WormMap and WormSet. #235

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

** New features and API changes

GH-235: Drop WormMap and WormSet.
Those associative containers implementing Worm Hashing were added in HPPC-176.
Since then, with improvements to HashMap, there is no clear advantage to using
WormMap. Dropping them helps to reduce the library size.

(Bruno Roustant).

** Improvements


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ public IntIntMapOps newIntIntMap(int expectedElements, double loadFactor) {
}
},

WORM {
@Override
public IntSetOps newIntSet(int expectedElements, double loadFactor) {
return new WormIntSetOps(expectedElements);
}

@Override
public IntIntMapOps newIntIntMap(int expectedElements, double loadFactor) {
return new WormIntIntMapOps(expectedElements);
}
},

PGM {
@Override
public IntSetOps newIntSet(int expectedElements, double loadFactor) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import static org.assertj.core.api.Assertions.*;

import com.carrotsearch.hppc.IntLongHashMap;
import com.carrotsearch.hppc.IntLongWormMap;
import com.carrotsearch.hppc.cursors.IntLongCursor;
import com.carrotsearch.hppc.procedures.IntLongProcedure;
import com.carrotsearch.hppc.procedures.IntProcedure;
Expand All @@ -24,13 +23,10 @@
public class HppcExample_004_IteratingOverMaps {

public IntLongHashMap hashMap;
public IntLongWormMap wormMap;

@Before
public void setup() {
hashMap = IntLongHashMap.from(new int[] {1, 1, 2, 3, 5, 0}, new long[] {1, 2, 3, 4, 5, 6});
// WormMap is a hash map efficient for less than 2M entries, and more get() than put().
wormMap = IntLongWormMap.from(new int[] {1, 1, 2, 3, 5, 0}, new long[] {1, 2, 3, 4, 5, 6});
}

/**
Expand Down Expand Up @@ -65,7 +61,7 @@ public void apply(int key, long value) {
/** A for-each type loop on keys. */
@Test
public void keys() {
wormMap
hashMap
.keys()
.forEach(
new IntProcedure() {
Expand Down
Loading
Loading