From b37f3acb1ed8978b45c32e64445bcbbb04bfd43c Mon Sep 17 00:00:00 2001 From: martinsumner Date: Fri, 23 Dec 2016 12:44:44 +0000 Subject: [PATCH] Extra timings --- src/leveled_sst.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/leveled_sst.erl b/src/leveled_sst.erl index 713e6c8..7a85d90 100644 --- a/src/leveled_sst.erl +++ b/src/leveled_sst.erl @@ -27,11 +27,18 @@ build_slot(KVList, HashList) when length(KVList) =< ?SLOT_SIZE -> + SW = os:timestamp(), SkipList = leveled_skiplist:to_sstlist(KVList), + io:format(user, "Changed to skiplist in ~w microseconds~n", + [timer:now_diff(os:timestamp(), SW)]), Bloom = lists:foldr(fun leveled_tinybloom:tiny_enter/2, leveled_tinybloom:tiny_empty(), HashList), + io:format(user, "Bloom added in ~w microseconds~n", + [timer:now_diff(os:timestamp(), SW)]), SlotBin = term_to_binary(SkipList, [{compressed, ?COMPRESSION_LEVEL}]), + io:format(user, "Converted to binary in ~w microseconds~n", + [timer:now_diff(os:timestamp(), SW)]), {SlotBin, Bloom}. is_check_slot_required(_Hash, none) -> @@ -113,8 +120,8 @@ simple_slotbin_test() -> SW0 = os:timestamp(), {SlotBin0, Bloom0} = build_slot(KVList1, HashList), - io:format(user, "~nSlot built in ~w microseconds~n", - [timer:now_diff(os:timestamp(), SW0)]), + io:format(user, "~nSlot built in ~w microseconds with size ~w~n", + [timer:now_diff(os:timestamp(), SW0), byte_size(SlotBin0)]), SW1 = os:timestamp(), lists:foreach(fun(H) -> ?assertMatch(true,