Skip to main content
Loading

Map Performance

For Versions < 3.16.0

OperationReturn TypeUnordered (1)K / KV-Ordered (2)K-Ordered (3)KV-Ordered (4)
Set Type OpsWith No IndexWith Offset IndexWith Full Index
set_type(t) on unordered1111
set_type(t) on k_orderedN log N111
set_type(t) on kv_orderedN log NN log NN log N1
Modify OpsWith No IndexWith Offset IndexWith Full Index
add(k,v)NNlog Nlog N
add_items(m)N·MN·MM log NM log N
increment(k,dv)
decrement(k,dv)
NNlog Nlog N
clear()1111
remove_by_key(k)BaseNNlog Nlog N
+Index+N+N+N+log N
remove_by_index(i)BaseL log N + NN11
+Rank+N+N+N+log N
remove_by_rank(r)BaseR log N + NR log N + NR log N1
+Index+N+1+1+1
remove_by_key_interval(v0,v1)BaseN + MN + Mlog N + Mlog N + M
+Rank+N log N+N log N+N log N+log N
remove_by_index_range(i,x)Base(L+M)log N + NN + MMM
+Rank+N log N+N log N+N log N+log N
remove_by_value_interval(v0,v1)
remove_all_by_value(v)
BaseN + MN + MN + Mlog N + M
+Index+N + M+M+M+M
remove_by_rank_range(r,x)Base(R+M)log N + N(R+M)log N + N(R+M) log NM log M
+Index+N log N+M+M+M
remove_all_by_key_list(m)BaseM log M + N·MM log M + N·MM log NM log N
+Index+N·M+M+M+M
remove_all_by_value_list(m)BaseM log M + N·MM log M + N·MM log M + N·MM log N
Read OpsWith No IndexWith Offset IndexWith Full Index
size()1111
get_by_key(k)See remove_by_key above.
get_by_index(i)See remove_by_index above.
get_by_rank(i)See remove_by_index above.
get_by_key_interval(v0,v1)BaseNNlog N + Mlog N + M
+Rank+N log N+N log N+N log N+log N
get_by_index_range(i,x)See remove_by_index_range above.
get_by_value_interval(v0,v1)
get_all_by_value(v)
See remove_by_value_interval above.
get_by_rank_range(r,x)Base(R+M)log N + N(R+M)log N + N(R+M) log NM
+Index+N log N+M+M+M
Mode ModifiersWith No IndexWith Offset IndexWith Full Index
Not-in-memory On-Disk+D + W
Data-in-memory On-Disk+W