#!/usr/bin/env qore
# -*- mode: qore; indent-tabs-mode: nil -*-

%new-style
%enable-all-warnings
%require-types
%strict-args

%requires uuid

softint size = shift ARGV ?? 1000000;

hash h;

date start = now_us();

# create a large hash
for (int i = 0; i < size; ++i)
    h{UUID::get()} = True;

printf("%d entries created in: %y\n", h.size(), now_us() - start);

start = now_us();
map $1.key, h.pairIterator();
printf("# -> iteration: %d\t%d\n", h.size(), (now_us() - start).durationMicroseconds());
