|
|
@ -580,10 +580,13 @@ etsT(Cnt, Num) -> |
|
|
|
etsT(Cnt, {50000, Num div 2}, Tab), |
|
|
|
ets:delete(Tab). |
|
|
|
|
|
|
|
etsInsert(0, _Tab) -> |
|
|
|
-record(etsT, {id, v1, v2}). |
|
|
|
|
|
|
|
etsInsert(0, Tab) -> |
|
|
|
ets:insert(Tab, {etsT, 50000, 500, 5001}), |
|
|
|
ok; |
|
|
|
etsInsert(N, Tab) -> |
|
|
|
ets:insert(Tab, {{rand:uniform(100000), N}, N}), |
|
|
|
ets:insert(Tab, {test, N, N, N + 1}), |
|
|
|
etsInsert(N - 1, Tab). |
|
|
|
|
|
|
|
-include_lib("stdlib/include/ms_transform.hrl"). |
|
|
@ -591,7 +594,19 @@ etsT(Cnt, Key, Tab) -> |
|
|
|
Ms = ets:fun2ms(fun({K, _V}) when Key > K -> true end), |
|
|
|
utTc:ts(Cnt, ets, select_count, [Tab, Ms]). |
|
|
|
|
|
|
|
etsM(Cnt, Num, Key) -> |
|
|
|
case ets:info(test, size) of |
|
|
|
undefined -> |
|
|
|
ets:new(test, [named_table, {keypos, #etsT.id}, set]), |
|
|
|
etsInsert(Num, test); |
|
|
|
_ -> |
|
|
|
ignore |
|
|
|
end, |
|
|
|
etsM(Cnt, Key). |
|
|
|
|
|
|
|
etsM(Cnt, Key) -> |
|
|
|
utTc:ts(Cnt, ets, match, [test, #etsT{id = Key, v1 = '$1', v2 = '$2'}]), |
|
|
|
ets:match(test, #etsT{id = Key, v1 = '$1', v2 = '$2'}). |
|
|
|
|
|
|
|
|
|
|
|
lMakeList(0, Acc) -> |
|
|
|