Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multiQuery optimization for has step [cql-tests] [tp-tests] #3724

Merged

Conversation

porunov
Copy link
Member

@porunov porunov commented Apr 20, 2023

Fixes #3244
See a follow up improvement issue which will be possible after this PR #3765


Thank you for contributing to JanusGraph!

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there an issue associated with this PR? Is it referenced in the commit message?
  • Does your PR body contain #xyz where xyz is the issue number you are trying to resolve?
  • Has your PR been rebased against the latest commit within the target branch (typically master)?
  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you written and/or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE.txt file, including the main LICENSE.txt file in the root of this repository?
  • If applicable, have you updated the NOTICE.txt file, including the main NOTICE.txt file found in the root of this repository?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

@janusgraph-bot janusgraph-bot added the cla: external Externally-managed CLA label Apr 20, 2023
@porunov porunov force-pushed the feature/has-step-multi-query-optimization branch from 9f31967 to 87381a0 Compare April 20, 2023 05:23
@porunov porunov force-pushed the feature/has-step-multi-query-optimization branch 4 times, most recently from 2478a7b to 8b920d2 Compare April 30, 2023 01:33
@porunov porunov force-pushed the feature/has-step-multi-query-optimization branch 4 times, most recently from f7a57e8 to 6e04a8c Compare May 9, 2023 16:03
@porunov porunov marked this pull request as ready for review May 9, 2023 16:15
@porunov porunov requested a review from a team May 9, 2023 16:16
@porunov porunov added this to the Release v1.0.0 milestone May 9, 2023
@porunov porunov force-pushed the feature/has-step-multi-query-optimization branch 2 times, most recently from 823fa76 to 8e88b60 Compare June 6, 2023 11:40
@porunov porunov changed the title Enable multiQuery optimization for has step Enable multiQuery optimization for has step [cql-tests] [tp-tests] Jun 6, 2023
@porunov porunov force-pushed the feature/has-step-multi-query-optimization branch 2 times, most recently from 2dd35e2 to ec4a023 Compare June 6, 2023 16:58
Fixes JanusGraph#3244

Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
@porunov porunov force-pushed the feature/has-step-multi-query-optimization branch from ec4a023 to 848a805 Compare June 6, 2023 17:00
@porunov
Copy link
Member Author

porunov commented Jun 6, 2023

Benchmarks

The benchmarks executed for master branch and this PR are the same with the only difference we used batchPropertiesPrefetching property (both true and false) for master branch (because this property doesn't exist in this PR anymore and used hasStepBatchMode for this PR (because it doesn't exist in master branch). This PR includes more tests because there are 4 states of hasStepBatchMode but only 2 states for batchPropertiesPrefetching.
Other than that the benchmarks are identical.

master branch benchmarks:

Benchmark                                                                         (batchPropertiesPrefetching)  (fanoutFactor)  (fastProperty)  Mode  Cnt      Score      Error  Units
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                 true             100            true  avgt    5    163.451 ±   10.255  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                 true             100           false  avgt    5    157.020 ±    3.354  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                 true             500            true  avgt    5  32666.314 ± 3936.217  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                 true             500           false  avgt    5  30405.447 ± 4804.196  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                false             100            true  avgt    5   1094.200 ±  152.153  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                false             100           false  avgt    5   1016.932 ±   93.619  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                false             500            true  avgt    5  33419.615 ± 1376.338  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                                false             500           false  avgt    5  34034.708 ± 4545.876  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                            true             100            true  avgt    5    149.142 ±    7.139  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                            true             100           false  avgt    5    141.773 ±    5.318  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                            true             500            true  avgt    5  30342.899 ± 1601.074  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                            true             500           false  avgt    5  30149.505 ± 5265.701  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                           false             100            true  avgt    5   1103.177 ±   56.356  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                           false             100           false  avgt    5   1022.243 ±   99.154  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                           false             500            true  avgt    5  32821.337 ± 1106.216  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep                           false             500           false  avgt    5  31677.913 ±  612.126  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                                true             100            true  avgt    5    105.794 ±    3.058  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                                true             100           false  avgt    5    100.623 ±    3.073  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                                true             500            true  avgt    5  30330.704 ±  977.744  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                                true             500           false  avgt    5  26708.707 ± 2025.749  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                               false             100            true  avgt    5   1014.697 ±   60.938  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                               false             100           false  avgt    5    912.799 ±   82.280  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                               false             500            true  avgt    5  31772.682 ± 2913.870  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                               false             500           false  avgt    5  28676.131 ± 2597.136  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                    true             100            true  avgt    5   1150.347 ±  387.364  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                    true             100           false  avgt    5    942.483 ±  309.687  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                    true             500            true  avgt    5  33556.125 ± 4505.178  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                    true             500           false  avgt    5  27582.542 ± 1815.113  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                   false             100            true  avgt    5   1088.719 ±  277.785  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                   false             100           false  avgt    5    917.483 ±   41.569  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                   false             500            true  avgt    5  32960.166 ± 3256.730  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                                   false             500           false  avgt    5  28935.212 ± 6013.404  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                          true             100            true  avgt    5   1061.225 ±  160.980  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                          true             100           false  avgt    5    889.679 ±   44.485  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                          true             500            true  avgt    5  32194.190 ± 1487.672  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                          true             500           false  avgt    5  28077.245 ± 1115.720  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                         false             100            true  avgt    5   1038.467 ±   50.943  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                         false             100           false  avgt    5    948.955 ±  197.418  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                         false             500            true  avgt    5  31466.019 ±  771.448  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut                         false             500           false  avgt    5  27302.069 ±  553.537  ms/op

Current PR benchmarks:

Benchmark                                                                         (fanoutFactor)  (fastProperty)                   (hasStepBatchMode)  Mode  Cnt     Score     Error  Units
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100            true                       all_properties  avgt    5   151.282 ±   7.389  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100            true             required_properties_only  avgt    5   152.164 ±   4.942  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100            true         required_and_next_properties  avgt    5   151.391 ±   3.160  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100            true  required_and_next_properties_or_all  avgt    5   150.348 ±   5.774  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100           false                       all_properties  avgt    5   148.165 ±   6.908  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100           false             required_properties_only  avgt    5   192.653 ±  16.411  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100           false         required_and_next_properties  avgt    5   147.334 ±   6.747  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    100           false  required_and_next_properties_or_all  avgt    5   144.917 ±   4.725  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500            true                       all_properties  avgt    5  4648.398 ± 177.671  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500            true             required_properties_only  avgt    5  4581.161 ± 141.965  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500            true         required_and_next_properties  avgt    5  4545.167 ± 173.200  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500            true  required_and_next_properties_or_all  avgt    5  4511.098 ±  96.264  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500           false                       all_properties  avgt    5  4484.164 ± 135.042  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500           false             required_properties_only  avgt    5  6203.244 ± 192.803  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500           false         required_and_next_properties  avgt    5  4541.163 ±  73.534  ms/op
CQLMultiQueryHasStepBenchmark.getAllPropertiesOfVerticesFilteredByHasStep                    500           false  required_and_next_properties_or_all  avgt    5  4692.531 ± 120.668  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100            true                       all_properties  avgt    5   142.673 ±   4.599  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100            true             required_properties_only  avgt    5   142.528 ±   5.152  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100            true         required_and_next_properties  avgt    5   144.915 ±   6.790  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100            true  required_and_next_properties_or_all  avgt    5   140.881 ±   4.945  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100           false                       all_properties  avgt    5   137.812 ±   8.170  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100           false             required_properties_only  avgt    5   203.841 ±  16.900  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100           false         required_and_next_properties  avgt    5   201.474 ±  14.083  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               100           false  required_and_next_properties_or_all  avgt    5   205.077 ±  16.424  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500            true                       all_properties  avgt    5  4381.410 ± 111.484  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500            true             required_properties_only  avgt    5  4361.109 ±  79.309  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500            true         required_and_next_properties  avgt    5  4421.750 ± 121.152  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500            true  required_and_next_properties_or_all  avgt    5  4372.719 ± 131.039  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500           false                       all_properties  avgt    5  4278.901 ± 117.761  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500           false             required_properties_only  avgt    5  7296.771 ± 185.282  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500           false         required_and_next_properties  avgt    5  7389.005 ±  94.414  ms/op
CQLMultiQueryHasStepBenchmark.getSpecificPropertiesOfVerticesFilteredByHasStep               500           false  required_and_next_properties_or_all  avgt    5  7427.384 ± 118.985  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100            true                       all_properties  avgt    5   104.345 ±   3.558  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100            true             required_properties_only  avgt    5   102.592 ±   2.654  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100            true         required_and_next_properties  avgt    5   103.397 ±   4.600  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100            true  required_and_next_properties_or_all  avgt    5   103.649 ±   4.636  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100           false                       all_properties  avgt    5   100.795 ±   4.506  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100           false             required_properties_only  avgt    5    86.954 ±   6.816  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100           false         required_and_next_properties  avgt    5    88.915 ±   4.872  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   100           false  required_and_next_properties_or_all  avgt    5   100.383 ±   3.663  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500            true                       all_properties  avgt    5  3308.656 ±  93.490  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500            true             required_properties_only  avgt    5  3431.005 ± 253.539  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500            true         required_and_next_properties  avgt    5  3388.843 ± 140.320  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500            true  required_and_next_properties_or_all  avgt    5  3377.509 ± 101.507  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500           false                       all_properties  avgt    5  3298.875 ±  99.266  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500           false             required_properties_only  avgt    5  3009.802 ± 105.046  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500           false         required_and_next_properties  avgt    5  3061.504 ±  91.296  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStep                                   500           false  required_and_next_properties_or_all  avgt    5  3304.168 ±  72.838  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100            true                       all_properties  avgt    5   116.261 ±   3.718  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100            true             required_properties_only  avgt    5   115.216 ±   4.564  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100            true         required_and_next_properties  avgt    5   114.293 ±   5.224  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100            true  required_and_next_properties_or_all  avgt    5   115.609 ±   4.324  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100           false                       all_properties  avgt    5   112.308 ±   5.087  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100           false             required_properties_only  avgt    5   102.355 ±  11.816  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100           false         required_and_next_properties  avgt    5    98.359 ±   6.464  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       100           false  required_and_next_properties_or_all  avgt    5   112.884 ±   3.810  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500            true                       all_properties  avgt    5  3654.501 ± 139.281  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500            true             required_properties_only  avgt    5  3777.397 ± 321.106  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500            true         required_and_next_properties  avgt    5  3730.928 ± 187.024  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500            true  required_and_next_properties_or_all  avgt    5  3673.827 ±  33.761  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500           false                       all_properties  avgt    5  3574.371 ± 272.017  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500           false             required_properties_only  avgt    5  3366.301 ± 102.916  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500           false         required_and_next_properties  avgt    5  3349.050 ± 104.527  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepInParentStep                       500           false  required_and_next_properties_or_all  avgt    5  3755.182 ± 398.489  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100            true                       all_properties  avgt    5   104.566 ±   4.243  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100            true             required_properties_only  avgt    5   104.223 ±   6.586  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100            true         required_and_next_properties  avgt    5   116.486 ±   3.945  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100            true  required_and_next_properties_or_all  avgt    5   108.029 ±   4.976  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100           false                       all_properties  avgt    5   103.158 ±   3.196  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100           false             required_properties_only  avgt    5    90.309 ±   6.764  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100           false         required_and_next_properties  avgt    5    87.164 ±   3.838  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             100           false  required_and_next_properties_or_all  avgt    5   101.792 ±   4.181  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500            true                       all_properties  avgt    5  3441.002 ± 209.789  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500            true             required_properties_only  avgt    5  3395.068 ±  65.144  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500            true         required_and_next_properties  avgt    5  3481.341 ± 324.534  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500            true  required_and_next_properties_or_all  avgt    5  3468.133 ± 303.957  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500           false                       all_properties  avgt    5  3414.685 ± 301.887  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500           false             required_properties_only  avgt    5  3102.938 ± 217.326  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500           false         required_and_next_properties  avgt    5  3249.353 ± 465.224  ms/op
CQLMultiQueryHasStepBenchmark.getVerticesFilteredByHasStepWithNonHasStepAfterOut             500           false  required_and_next_properties_or_all  avgt    5  3486.909 ± 532.665  ms/op

Conclusion:
Performance is the same for cases when we can detect the next has step usage, but for many added cases we gain 9-10 times better performance. This is simply because batchPropertiesPrefetching sometimes couldn't detect that the next performing step is has step (because the next step couldn't be another step following by has step or simply be a parent step which forwards the traverser). Current approach relays on has step itself thus the detection of has step usage if straight forward.

@porunov
Copy link
Member Author

porunov commented Jun 6, 2023

I'm merging this PR by following lazy consensus.
There are some small documentation nitpicks I want to address, but I prefer to do that with CTR separately to not trigger full test suit again (with tinkerpop and cql tests).

@porunov porunov merged commit 5b042b4 into JanusGraph:master Jun 6, 2023
189 checks passed
porunov added a commit to porunov/janusgraph that referenced this pull request Jun 7, 2023
Follow up to JanusGraph#3724

Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
porunov added a commit that referenced this pull request Jun 7, 2023
Follow up to #3724

Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: external Externally-managed CLA
Projects
Development

Successfully merging this pull request may close these issues.

Enable multiQuery optimization for has step
2 participants