Skip to content

Commit 8dd90aa

Browse files
committed
runtime: 缓存叶子的 ART 父节点,兄弟 key 共用(#268
iops N=2000 26.3ms → 23.0ms (−13%) prime_sieve N=100 29.6ms → 26.8ms (−9%) hash_table N=200 18.0ms → 15.6ms (−13%)
1 parent d1b9d1d commit 8dd90aa

5 files changed

Lines changed: 577 additions & 44 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
timestamp,version,commit,cpu,case,input,samples,kvlang_shm_ns,kvlang_fs_ns,kvlang_redis_ns,python_ns,rust_ns,c_ns,python_ver,rust_ver,c_ver,native_opt,valid
2+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,binary_search,16,3,,,,11798,742,531,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
3+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,binary_search,N=32,3,11248867,,,20484,1398,1032,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
4+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,binary_search,N=64,3,25728718,,,42554,2911,2276,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
5+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,binary_trees,depth=4,3,4995333,,,10191,2461,6522,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
6+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,binary_trees,depth=5,3,8572702,,,19169,2984,7000,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
7+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,binary_trees,depth=6,3,18040546,,,33821,4343,9618,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
8+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,fib,n=8,3,5269445,,,9070,282,305,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
9+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,fib,n=9,3,8595727,,,10836,352,428,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
10+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,fib,n=10,3,13916483,,,14007,461,563,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
11+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,hash_table,N=50,3,4120698,,,22577,4590,300,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
12+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,hash_table,N=100,3,7761466,,,36046,7110,415,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,False
13+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,hash_table,N=200,3,15613934,,,71182,13362,641,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,False
14+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,iops,N=500,3,6141164,,,22309,311,288,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
15+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,iops,N=1000,3,12440658,,,41561,494,477,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
16+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,iops,N=2000,3,22967493,,,80723,854,815,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
17+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,k_nucleotide,rep=3,3,9486496,,,26614,2902,233,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
18+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,k_nucleotide,rep=5,3,18489269,,,38783,5402,326,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
19+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,k_nucleotide,rep=8,3,32838675,,,58638,6403,485,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
20+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,matmul,4,3,,,,13664,283,307,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
21+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,matmul,6,3,,,,36635,458,311,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
22+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,matmul,8,3,,,,73670,654,512,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
23+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,nqueens,4,3,,,,17756,282,243,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
24+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,nqueens,5,3,,,,31120,521,525,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
25+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,nqueens,6,3,,,,68969,1361,1402,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
26+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,prime_sieve,N=50,3,9680882,,,29576,19297,28774,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
27+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,prime_sieve,N=75,3,18065222,,,50362,23877,30867,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
28+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,prime_sieve,N=100,3,26816330,,,67240,29433,28993,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
29+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,quicksort,"N=32,seed=1",3,7634563,,,18481,1095,1040,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
30+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,quicksort,"N=64,seed=1",3,16653101,,,38223,2449,2124,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True
31+
2026-09-13T08:58:16Z,v0.2.17-14-g8e0bb9ef,8e0bb9e,Intel(R) Xeon(R) Gold 6418H,quicksort,"N=128,seed=1",3,31409672,,,73365,5095,4847,3.10.12,1.98.0,14.3.0,gcc -O1 / rustc opt-level=1 / cpython,True

runtime/CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(CMAKE_C_STANDARD 11)
55
set(CMAKE_C_STANDARD_REQUIRED ON)
66
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
77

8-
# ── 输出统一到 bin/ ──────────────────────────────────────────────
8+
# Outputs go under bin/.
99
set(BIN_DIR "${CMAKE_SOURCE_DIR}/../bin")
1010
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BIN_DIR}")
1111
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BIN_DIR}")
@@ -15,10 +15,23 @@ add_library(kvlang_runtime SHARED ${KVLANG_RUNTIME_SRC})
1515
target_include_directories(kvlang_runtime PUBLIC include src)
1616
target_compile_definitions(kvlang_runtime PRIVATE _GNU_SOURCE)
1717

18-
# 链接 kvspace dispatch 前端(已安装 /usr/lib),运行期按 DSN 选后端,编译期不再选后端。
19-
# 链接 kvspace dispatch 前端(与后端同装 /usr/lib/kvspace),运行期按 DSN 选后端,编译期不再选后端。
18+
# Link kvspace dispatch; backend is selected at runtime from the DSN.
2019
target_link_directories(kvlang_runtime PRIVATE /usr/lib/kvspace)
2120
target_link_libraries(kvlang_runtime PRIVATE kvspace m pthread)
2221

23-
# --export-dynamic 供 kvlang(term 扩展)找符号;--disable-new-dtags 使 rpath DT_RPATH(传递)。
22+
# --export-dynamic for term extensions; --disable-new-dtags so rpath is DT_RPATH.
2423
set_target_properties(kvlang_runtime PROPERTIES LINK_FLAGS "-Wl,--export-dynamic -Wl,--disable-new-dtags -Wl,-rpath,/usr/lib/kvspace")
24+
25+
add_custom_command(
26+
OUTPUT "${BIN_DIR}/test_getmember_siblings"
27+
COMMAND ${CMAKE_C_COMPILER} -O2 -D_GNU_SOURCE
28+
-I${CMAKE_SOURCE_DIR}/include -I${CMAKE_SOURCE_DIR}/src
29+
${CMAKE_SOURCE_DIR}/tests/test_getmember_siblings.c
30+
-o ${BIN_DIR}/test_getmember_siblings
31+
-L${BIN_DIR}
32+
-Wl,--disable-new-dtags
33+
-Wl,-rpath,${BIN_DIR}
34+
-Wl,--no-as-needed -lkvspace -Wl,--as-needed -lkvlang_runtime
35+
DEPENDS kvlang_runtime "${CMAKE_SOURCE_DIR}/tests/test_getmember_siblings.c"
36+
VERBATIM)
37+
add_custom_target(test_getmember_siblings ALL DEPENDS "${BIN_DIR}/test_getmember_siblings")

0 commit comments

Comments
 (0)