Skip to main content

Sets

caution

These benchmarks should not be used as a definitive answer to which collections are best. It's typical for different implementations to perform better for specific use cases. You are strongly encouraged to verify any results.

Also bear in mind that these numbers are in microseconds.

N = 10addaddAll (different)addAll (same)containsremove
Dart Set0.223.362.990.320.23
Dartz Set2.3425.5712.810.791.79
FIC ISet0.4614.165.520.436.81
Ribs ISet7.7416.520.490.567.27
Ribs MSet0.263.343.060.460.23
N = 100addaddAll (different)addAll (same)containsremove
Dart Set0.2132.1924.470.320.18
Dartz Set3.47419.93266.391.162.60
FIC ISet0.45142.4728.480.4347.22
Ribs ISet1.61246.640.491.140.85
Ribs MSet0.2635.1435.230.450.23
N = 1000addaddAll (different)addAll (same)containsremove
Dart Set0.21359.39236.850.310.22
Dartz Set4.545445.823904.191.453.66
FIC ISet0.461282.51269.650.42392.05
Ribs ISet1.222294.610.481.120.86
Ribs MSet0.28447.29383.990.500.24
N = 10000addaddAll (different)addAll (same)containsremove
Dart Set0.212895.472384.160.310.18
Dartz Set6.1271305.9752743.821.714.69
FIC ISet0.4514703.832689.550.425321.72
Ribs ISet1.2324720.560.491.121.06
Ribs MSet0.265274.933806.190.450.24
N = 100000addaddAll (different)addAll (same)containsremove
Dart Set0.2343079.0627273.680.320.18
Dartz Set7.611066987.50802796.002.077.20
FIC ISet0.45458190.2054272.680.43103934.64
Ribs ISet1.64355395.500.491.751.61
Ribs MSet0.2679470.2350065.310.450.23
N = 1000000addaddAll (different)addAll (same)containsremove
Dart Set0.22900809.00461075.400.330.18
Dartz Set8.9812626918.5010597567.502.408.29
FIC ISet0.455994375.501597626.000.431454784.50
Ribs ISet2.013651381.500.491.741.61
Ribs MSet0.271362908.50773740.000.460.25