Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Implement synchronous APIs for Node.js bindings - #5058

Merged
mewim merged 6 commits into
masterfrom
nodejs-sync-apis
Mar 16, 2025
Merged

mewim merged 6 commits into
masterfrom
nodejs-sync-apis

Conversation

@mewim

@mewim mewim commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

Description

This PR adds synchronous API interfaces for Node.js bindings. These functions can block main thread, but is easier to use and more efficient if the query is small or being used for scripting (so that blocking main thread is fine).

@github-actions

Copy link
Copy Markdown

Benchmark Result

Master commit hash: 370e66c78023b8bbebc42f1e734f461c63d02d0a
Branch commit hash: 7ee3e0cd03300fd5226303bd739d7989d77600a1

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 732.74 731.21 1.52 (0.21%)
aggregation q28 6561.03 6559.23 1.81 (0.03%)
filter q14 126.01 127.31 -1.29 (-1.02%)
filter q15 130.72 124.75 5.97 (4.78%)
filter q16 340.60 340.29 0.31 (0.09%)
filter q17 447.81 444.49 3.32 (0.75%)
filter q18 2004.95 1988.87 16.08 (0.81%)
filter zonemap-node 89.12 88.50 0.62 (0.71%)
filter zonemap-node-lhs-cast 88.57 88.68 -0.11 (-0.12%)
filter zonemap-node-null 90.46 89.62 0.84 (0.94%)
filter zonemap-rel 5791.74 5754.58 37.16 (0.65%)
fixed_size_expr_evaluator q07 686.35 687.16 -0.81 (-0.12%)
fixed_size_expr_evaluator q08 973.66 970.96 2.70 (0.28%)
fixed_size_expr_evaluator q09 973.67 972.14 1.53 (0.16%)
fixed_size_expr_evaluator q10 262.94 261.26 1.68 (0.64%)
fixed_size_expr_evaluator q11 262.21 260.81 1.39 (0.53%)
fixed_size_expr_evaluator q12 239.94 241.91 -1.97 (-0.81%)
fixed_size_expr_evaluator q13 1564.78 1560.90 3.88 (0.25%)
fixed_size_seq_scan q23 120.52 118.91 1.61 (1.36%)
join q29 715.90 751.42 -35.52 (-4.73%)
join q30 1611.16 1654.01 -42.85 (-2.59%)
join q31 4.72 5.18 -0.46 (-8.86%)
join SelectiveTwoHopJoin 49.05 46.30 2.75 (5.94%)
ldbc_snb_ic q35 9.05 10.80 -1.75 (-16.22%)
ldbc_snb_ic q36 94.52 102.22 -7.70 (-7.53%)
ldbc_snb_is q32 4.33 4.01 0.32 (8.09%)
ldbc_snb_is q33 14.33 11.97 2.36 (19.76%)
ldbc_snb_is q34 1.27 1.34 -0.07 (-5.46%)
multi-rel multi-rel-large-scan 1729.02 1750.95 -21.93 (-1.25%)
multi-rel multi-rel-lookup 9.86 11.69 -1.83 (-15.68%)
multi-rel multi-rel-small-scan 194.05 205.88 -11.84 (-5.75%)
order_by q25 133.08 133.83 -0.75 (-0.56%)
order_by q26 447.82 448.08 -0.25 (-0.06%)
order_by q27 1379.02 1379.04 -0.02 (-0.00%)
recursive_join recursive-join-bidirection 309.15 270.82 38.32 (14.15%)
recursive_join recursive-join-dense 7174.61 5325.84 1848.76 (34.71%)
recursive_join recursive-join-path 23211.10 22428.92 782.18 (3.49%)
recursive_join recursive-join-sparse 637.31 628.72 8.59 (1.37%)
recursive_join recursive-join-trail 7087.97 5662.44 1425.53 (25.18%)
scan_after_filter q01 168.32 170.04 -1.72 (-1.01%)
scan_after_filter q02 155.32 155.22 0.10 (0.07%)
shortest_path_ldbc100 q37 87.93 79.83 8.10 (10.15%)
shortest_path_ldbc100 q38 338.96 321.45 17.51 (5.45%)
shortest_path_ldbc100 q39 55.47 55.29 0.18 (0.33%)
shortest_path_ldbc100 q40 412.21 397.05 15.16 (3.82%)
var_size_expr_evaluator q03 2089.86 2087.93 1.93 (0.09%)
var_size_expr_evaluator q04 2305.86 2317.17 -11.31 (-0.49%)
var_size_expr_evaluator q05 2729.30 2727.71 1.59 (0.06%)
var_size_expr_evaluator q06 1345.83 1338.56 7.26 (0.54%)
var_size_seq_scan q19 1438.18 1433.00 5.18 (0.36%)
var_size_seq_scan q20 2710.98 2705.76 5.22 (0.19%)
var_size_seq_scan q21 2257.37 2274.41 -17.04 (-0.75%)
var_size_seq_scan q22 125.02 126.03 -1.01 (-0.80%)

@mewim
mewim merged commit 0fb5536 into master Mar 16, 2025
@mewim
mewim deleted the nodejs-sync-apis branch March 16, 2025 23:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants