Ongoing timing tests
This commit is contained in:
parent
b855401696
commit
b509e81cfd
1 changed files with 10 additions and 5 deletions
|
@ -1003,19 +1003,24 @@ experimental_test() ->
|
||||||
"Created slot in ~w microseconds~n",
|
"Created slot in ~w microseconds~n",
|
||||||
[timer:now_diff(os:timestamp(), SWA0)]),
|
[timer:now_diff(os:timestamp(), SWA0)]),
|
||||||
|
|
||||||
% {TestK1, TestV1} = lists:nth(16, KVL1),
|
{TestK1, TestV1} = lists:nth(16, KVL1),
|
||||||
{TestK2, TestV2} = lists:nth(64, KVL1),
|
{TestK2, TestV2} = lists:nth(64, KVL1),
|
||||||
% {TestK3, TestV3} = lists:nth(96, KVL1),
|
{TestK3, TestV3} = lists:nth(96, KVL1),
|
||||||
|
test_slot(SlotBin, TestK1, TestV1),
|
||||||
|
test_slot(SlotBin, TestK2, TestV2),
|
||||||
|
test_slot(SlotBin, TestK3, TestV3).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
test_slot(SlotBin, Key, Value) ->
|
||||||
SWA1 = os:timestamp(),
|
SWA1 = os:timestamp(),
|
||||||
Slot0 = binary_to_term(SlotBin),
|
Slot0 = binary_to_term(SlotBin),
|
||||||
{value, TestV2} = gb_trees:lookup(TestK2, Slot0),
|
{value, Value} = gb_trees:lookup(Key, Slot0),
|
||||||
io:format(user,
|
io:format(user,
|
||||||
"Looked in slot in ~w microseconds~n",
|
"Looked in slot in ~w microseconds~n",
|
||||||
[timer:now_diff(os:timestamp(), SWA1)]).
|
[timer:now_diff(os:timestamp(), SWA1)]).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
merge_test() ->
|
merge_test() ->
|
||||||
N = 3000,
|
N = 3000,
|
||||||
KVL1 = lists:ukeysort(1, generate_randomkeys(N + 1, N, 1, 20)),
|
KVL1 = lists:ukeysort(1, generate_randomkeys(N + 1, N, 1, 20)),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue