Skip to content

Conversation

royi-luo
Copy link
Contributor

@royi-luo royi-luo commented Feb 5, 2025

Description

Added a template file cmake/templates/system_config.h.in that uses CMake's configure_file that is used to generate the header ${CMAKE_BINARY_DIR}/src/include/common/system_config.h which contains all of our compile-time configurations. Also added ${CMAKE_BINARY_DIR}/src/include as an include directory so that we can include the generated header as common/system_config.h

This means that when we recompile with a different configuration, only files that include the generated system_config.h will be recompiled (with the existing method of using compile definitions the whole project will be recompiled each time a configuration is changed).

Speedup

Master

image

New

image
With the current changes I got the number of recompile steps reduced to 569 from 777

I've gotten the speedup to improve to about 220 steps by making changes to the code (e.g. reorganizing includes, moving stuff from header to cpp file) but I'll put that in a separate PR since it's a large change.

Contributor agreement

@royi-luo royi-luo self-assigned this Feb 5, 2025
@royi-luo royi-luo force-pushed the royi/speed-up-constants-recompilation branch from b9a29d2 to faaa6bc Compare February 5, 2025 15:31
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 93.65079% with 4 lines in your changes missing coverage. Please review.

Project coverage is 86.55%. Comparing base (32e5cbf) to head (d5329c8).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/binder/bind/ddl/bound_create_table_info.cpp 78.57% 3 Missing ⚠️
src/storage/store/node_group.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4850   +/-   ##
=======================================
  Coverage   86.55%   86.55%           
=======================================
  Files        1397     1397           
  Lines       60489    60515   +26     
  Branches     7452     7453    +1     
=======================================
+ Hits        52355    52380   +25     
  Misses       7966     7966           
- Partials      168      169    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@royi-luo royi-luo marked this pull request as ready for review February 5, 2025 22:56
@royi-luo royi-luo requested review from ray6080 and removed request for ray6080 February 5, 2025 22:56
@royi-luo royi-luo marked this pull request as draft February 5, 2025 23:04
@royi-luo royi-luo mentioned this pull request Feb 6, 2025
1 task
@royi-luo royi-luo force-pushed the royi/speed-up-constants-recompilation branch from 97d7645 to 060a86a Compare February 6, 2025 19:08
@royi-luo royi-luo force-pushed the royi/speed-up-constants-recompilation branch from 060a86a to e414205 Compare February 6, 2025 19:11
Comment on lines -286 to -289
- name: Test with coverage vector capacity of 2
run: |
make lcov VECTOR_CAPACITY_LOG2=1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realised that this doesn't work since recompiling overwrites the coverage data from previous runs. If we want to include it we'll need to find a way to merge the coverage data from multiple runs from different builds.

Copy link

github-actions bot commented Feb 6, 2025

Benchmark Result

Master commit hash: 3e278c035ce911c16d8d43fc5d6b0034bae3b184
Branch commit hash: ea02cfe861e7574f94f42ab4985dbb8ec1851296

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 710.44 695.71 14.74 (2.12%)
aggregation q28 6355.45 6324.70 30.75 (0.49%)
filter q14 126.66 118.31 8.35 (7.06%)
filter q15 128.37 115.41 12.96 (11.23%)
filter q16 302.45 299.04 3.41 (1.14%)
filter q17 445.28 436.69 8.59 (1.97%)
filter q18 1984.41 1887.60 96.81 (5.13%)
filter zonemap-node 89.88 81.15 8.73 (10.76%)
filter zonemap-node-lhs-cast 91.88 81.27 10.61 (13.05%)
filter zonemap-node-null 90.84 80.90 9.94 (12.29%)
filter zonemap-rel 5472.29 5426.20 46.09 (0.85%)
fixed_size_expr_evaluator q07 579.75 562.89 16.86 (3.00%)
fixed_size_expr_evaluator q08 810.31 797.17 13.13 (1.65%)
fixed_size_expr_evaluator q09 807.96 796.09 11.87 (1.49%)
fixed_size_expr_evaluator q10 243.81 230.34 13.46 (5.85%)
fixed_size_expr_evaluator q11 239.03 222.24 16.79 (7.55%)
fixed_size_expr_evaluator q12 233.61 218.72 14.89 (6.81%)
fixed_size_expr_evaluator q13 1460.59 1446.33 14.26 (0.99%)
fixed_size_seq_scan q23 116.86 104.12 12.74 (12.23%)
join q29 654.38 626.88 27.49 (4.39%)
join q30 10745.05 10194.65 550.40 (5.40%)
join q31 6.05 7.34 -1.29 (-17.62%)
join SelectiveTwoHopJoin 55.54 60.19 -4.65 (-7.72%)
ldbc_snb_ic q35 2775.50 2650.08 125.43 (4.73%)
ldbc_snb_ic q36 442.13 451.36 -9.23 (-2.04%)
ldbc_snb_is q32 3.66 4.19 -0.53 (-12.64%)
ldbc_snb_is q33 13.57 16.75 -3.19 (-19.04%)
ldbc_snb_is q34 1.44 1.37 0.06 (4.64%)
multi-rel multi-rel-large-scan 1521.63 1435.58 86.05 (5.99%)
multi-rel multi-rel-lookup 12.05 15.01 -2.96 (-19.70%)
multi-rel multi-rel-small-scan 100.45 96.92 3.53 (3.64%)
order_by q25 132.15 128.19 3.97 (3.09%)
order_by q26 450.70 444.79 5.91 (1.33%)
order_by q27 1475.54 1448.73 26.81 (1.85%)
recursive_join recursive-join-bidirection 306.60 291.89 14.70 (5.04%)
recursive_join recursive-join-dense 7379.56 7411.88 -32.32 (-0.44%)
recursive_join recursive-join-path 23421.68 23322.21 99.48 (0.43%)
recursive_join recursive-join-sparse 1056.42 1066.43 -10.01 (-0.94%)
recursive_join recursive-join-trail 7345.25 7356.43 -11.18 (-0.15%)
scan_after_filter q01 194.11 162.46 31.65 (19.48%)
scan_after_filter q02 177.81 147.67 30.15 (20.41%)
shortest_path_ldbc100 q37 92.53 83.13 9.40 (11.31%)
shortest_path_ldbc100 q38 377.01 376.28 0.72 (0.19%)
shortest_path_ldbc100 q39 67.19 65.52 1.68 (2.56%)
shortest_path_ldbc100 q40 468.39 453.68 14.71 (3.24%)
var_size_expr_evaluator q03 2102.75 2087.48 15.27 (0.73%)
var_size_expr_evaluator q04 2243.82 2208.92 34.90 (1.58%)
var_size_expr_evaluator q05 2698.69 2636.47 62.23 (2.36%)
var_size_expr_evaluator q06 1359.42 1384.57 -25.16 (-1.82%)
var_size_seq_scan q19 1468.38 1632.22 -163.85 (-10.04%)
var_size_seq_scan q20 2348.81 2520.89 -172.08 (-6.83%)
var_size_seq_scan q21 2327.99 2382.83 -54.83 (-2.30%)
var_size_seq_scan q22 129.13 124.60 4.53 (3.63%)

@royi-luo royi-luo marked this pull request as ready for review February 6, 2025 20:50
@royi-luo royi-luo requested a review from ray6080 February 6, 2025 20:50
@@ -131,6 +131,7 @@ fn build_bundled_cmake() -> Result<Vec<PathBuf>, Box<dyn std::error::Error>> {
Ok(vec![
kuzu_root.join("src/include"),
build_dir.join("build/src"),
build_dir.join("build/src/include"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjaminwinger can you take a look at the rust build changes here to see if they make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@kuzudb kuzudb deleted a comment from github-actions bot Feb 6, 2025
@kuzudb kuzudb deleted a comment from github-actions bot Feb 6, 2025
@ray6080
Copy link
Contributor

ray6080 commented Feb 7, 2025

@benjaminwinger can I delegate the review of this PR to you? I don't think I need to be involved here.

@@ -131,6 +131,7 @@ fn build_bundled_cmake() -> Result<Vec<PathBuf>, Box<dyn std::error::Error>> {
Ok(vec![
kuzu_root.join("src/include"),
build_dir.join("build/src"),
build_dir.join("build/src/include"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@royi-luo royi-luo merged commit d84585c into master Feb 7, 2025
25 checks passed
@royi-luo royi-luo deleted the royi/speed-up-constants-recompilation branch February 7, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants