summaryrefslogtreecommitdiff
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-01 00:47:56 +0800
committerruki <[email protected]>2025-10-01 00:47:56 +0800
commit9dc8bb99439f4d31e3563a5865764798c2094e8e (patch)
tree911e222e99d1df86804f1380940f829045fbe97b /tests/benchmarks
parent672470e6e4ea7fd150354c131ba5fb60f7331643 (diff)
improve random hash
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/hash.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/benchmarks/hash.lua b/tests/benchmarks/hash.lua
index 554f3f166..0f33684a0 100644
--- a/tests/benchmarks/hash.lua
+++ b/tests/benchmarks/hash.lua
@@ -129,37 +129,37 @@ function test_random_uuid()
print("uuid(%d): %d ms, hash: %s", COUNT, t * 1000, h)
end
-function test_random32()
+function test_rand32()
local h
local n = COUNT / 10
local t = os.mclock()
for i = 1, n do
- h = hash.random32()
+ h = hash.rand32()
end
t = os.mclock() - t
- print("random32(%d): %d ms, hash: %s", COUNT, t * 10, h)
+ print("rand32(%d): %d ms, hash: %s", COUNT, t * 10, h)
end
-function test_random64()
+function test_rand64()
local h
local n = COUNT / 10
local t = os.mclock()
for i = 1, n do
- h = hash.random64()
+ h = hash.rand64()
end
t = os.mclock() - t
- print("random64(%d): %d ms, hash: %s", COUNT, t * 10, h)
+ print("rand64(%d): %d ms, hash: %s", COUNT, t * 10, h)
end
-function test_random128()
+function test_rand128()
local h
local n = COUNT / 10
local t = os.mclock()
for i = 1, n do
- h = hash.random128()
+ h = hash.rand128()
end
t = os.mclock() - t
- print("random128(%d): %d ms, hash: %s", COUNT, t * 10, h)
+ print("rand128(%d): %d ms, hash: %s", COUNT, t * 10, h)
end
function test_longstr()
@@ -202,9 +202,9 @@ end
function test_random()
print("========================================== test random ==========================================")
test_random_uuid()
- test_random32()
- test_random64()
- test_random128()
+ test_rand32()
+ test_rand64()
+ test_rand128()
end
function main()