//from collections.repset(T=int) access RepSet_T as RepSet_int; //from collections.hashrepset(T=int) access HashRepSet_T as HashRepSet_int; //from collections.btreegeneral(T=int) access BTreeRepSet_T as BTreeRepSet_int; from collections.map(K=int, V=int) access Map_K_V as Map_int_int; from collections.hashmap(K=int, V=int) access HashMap_K_V as HashMap_int_int; from collections.btreemap(K=int, V=int) access BTreeMap_K_V as BTreeMap_int_int; from collections.zip2(K=Map_int_int, V=string) access zip, operator cast; // Run a sequence of operations on a Map_K_V and measure elapsed time. cputime benchmark(Map_int_int map, int operations, int size=operations#2) { assert(size % 43 != 0, 'size must not be divisible by 43'); assert(size % 31667 != 0, 'size must not be divisible by 31667'); cputime(); // Insert operations int i = 0; do { i = (i + 43) % size; map[i] = i; } while(i != 0); // Retrieve operations int t = 0; int ceiling = size + size; for(int i=0; i