Ongoing timing tests

This commit is contained in:
martinsumner 2016-12-29 14:14:09 +00:00
parent b855401696
commit b509e81cfd

View file

@ -1003,18 +1003,23 @@ 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,