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 PropertyMapStep and ElementMapStep [cql-tests] [tp-tests] #3803

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

porunov
Copy link
Member

@porunov porunov commented Jun 7, 2023

Adds possibility to fetch properties and labels of vertices using valueMap, elementMap, propertyMap steps.

Adds fetching modes to properties, values, valueMap, elementMap, propertyMap steps to be able to preFetch all properties (single slice query) or only required properties (separate slice query per each requested property).

Fixes #2444
Fixes #3814


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?

@porunov porunov added this to the Release v1.0.0 milestone Jun 7, 2023
@janusgraph-bot janusgraph-bot added the cla: external Externally-managed CLA label Jun 7, 2023
@porunov porunov force-pushed the feature/property-map-multi-query branch 2 times, most recently from f3cdce1 to 0588749 Compare June 8, 2023 12:21
@porunov porunov changed the title Enable multiQuery optimization for PropertyMapStep and ElementMapStep Enable multiQuery optimization for PropertyMapStep and ElementMapStep [cql-tests] [tp-tests] Jun 9, 2023
@porunov porunov force-pushed the feature/property-map-multi-query branch 2 times, most recently from 6912efd to 4ee27d0 Compare June 9, 2023 10:47
@porunov porunov marked this pull request as ready for review June 9, 2023 11:43
Copy link
Member

@FlorianHockmann FlorianHockmann left a comment

Choose a reason for hiding this comment

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

I've only reviewed the doc changes and a small part of the code changes so far. Will try to review the rest of the code changes next week, but I'm not sure yet whether I'll find enough time for that and wanted to already submit my only comment I have at the moment (meaning the inline comment, not this one^^).

@@ -372,6 +372,7 @@ behaves same as `all_properties`.<br>- `required_and_next_properties_or_all` Pre
`values`, `properties,` `valueMap`, `elementMap`, or `propertyMap` then acts like `all_properties`.<br>- `none` Skips `has` step batch properties pre-fetch optimization.<br> | String | required_and_next_properties | MASKABLE |
| query.batch.limited | Configure a maximum batch size for queries against the storage backend. This can be used to ensure responsiveness if batches tend to grow very large. The used batch size is equivalent to the barrier size of a preceding `barrier()` step. If a step has no preceding `barrier()`, the default barrier of TinkerPop will be inserted. This option only takes effect if `query.batch.enabled` is `true`. | Boolean | true | MASKABLE |
| query.batch.limited-size | Default batch size (barrier() step size) for queries. This size is applied only for cases where `LazyBarrierStrategy` strategy didn't apply `barrier` step and where user didn't apply barrier step either. This option is used only when `query.batch.limited` is `true`. Notice, value `2147483647` is considered to be unlimited. | Integer | 2500 | MASKABLE |
| query.batch.properties-mode | Properties pre-fetching mode for `values`, `properties`, `valueMap`, `propertyMap`, `elementMap` steps. Used only when query.batch.enabled is `true`.<br>Supported modes:<br>- `all_properties` Pre-fetch all vertex properties on any property access (fetches all vertex properties in a single slice query)<br>- `required_properties_only` Pre-fetch necessary vertex properties only (uses a separate slice query per each required property)<br>- `none` Skips vertex properties pre-fetching optimization.<br> | String | required_properties_only | MASKABLE |
Copy link
Member

Choose a reason for hiding this comment

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

I haven't looked into the implementation, so only writing this after reading the the description here:

If I use all_properties, then it fetches all vertex properties in a single slice query, but if I use the default of required_properties_only , then it uses a separate slice query per each required property.
So if my vertices all have the same 10 properties and I want all of them, then all_properties will just perform one backend query, but required_properties_only will perform 10?

This sounds to me like I'm getting a better performance with all_properties in this example, but then I have to accept the downside that I will also fetch properties for other traversals that I don't need if I for example only want one specific property there. Is that correct?
Wouldn't it also make sense to use just one query for required_properties_only?

Copy link
Member Author

@porunov porunov Jun 9, 2023

Choose a reason for hiding this comment

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

This sounds to me like I'm getting a better performance with all_properties in this example, but then I have to accept the downside that I will also fetch properties for other traversals that I don't need if I for example only want one specific property there. Is that correct?
Wouldn't it also make sense to use just one query for required_properties_only?

Declimer: Right now, in master branch, JanusGraph always fetches ALL vertex properties using values, properties, valueMap, propertyMap, elementMap (and other steps) because of the default setting query.fast-property = true. If we change query.fast-property = false it fetches each vertex property in a separate slice query.

Of course, it would be really great to be able to fetch multiple selected properties using a single slice query, but not easy with the current JanusGraph data structure. At this moment JanusGraph can't retrieve two separate properties in a single slice query. JanusGraph knows how to retrieve a single specific property or all properties.

To explain why, let's imagine the next row:
propertyA: foo; propertyB: bar; propertyC: fooBar
Now, let's imagine the user wants to retrieve propertyA and propertyB. How JanusGraph suppose to construct a single Slice query to retrieve only those two properties without propertyB?
At this moment JanusGraph can't do that. I think we could implement something like multi-slice query or batched-slice query, so that JanusGraph can specify multiple ranges which it is interested in.

Nevertheless, this work of multi-property slice queries is beyond the current PR. I think if we implement it then query.fast-property will become obsolete because users would always prefer retrieving only necessary properties in a single query. Right now JanusGraph users need to make trade offs between query.fast-property = true or query.fast-property = false. Same with these batch configurations. Users need to make trade offs between retrieving only required properties (multiple backend requests but no redundant data fetched) or retrieving all properties (a single backend request but redundant data may be fetched).

P.S. I have plans to cover this topic later in a more in-depth blog post.

Copy link
Member

@li-boxuan li-boxuan Jun 11, 2023

Choose a reason for hiding this comment

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

IIRC label is not fetched in all_properties mode (or equivalently, when fast-property=true). IMO if the overhead is not large (in other words, if this does not lead to an extra backend call), we should also fetch label. The reason is:

Let's say the user has an index that only applies to the vertex label god.

mgmt.buildIndex('byNameAndLabel', Vertex.class).addKey(name).indexOnly(god).buildCompositeIndex()

When JanusGraph upserts the property name for ANY vertex, it has to check the label of that vertex. This OFTEN leads to a backend call because the label of that vertex is not cached, even if fast-property=true (again, I am not 100% sure but that's what I remember).

This is not really part of this PR per se, but I just want to bring this issue to your attention since you are working on this area.

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC label is not fetched in all_properties mode (or equivalently, when fast-property=true). IMO if the overhead is not large (in other words, if this does not lead to an extra backend call), we should also fetch label. The reason is:

Let's say the user has an index that only applies to the vertex label god.

mgmt.buildIndex('byNameAndLabel', Vertex.class).addKey(name).indexOnly(god).buildCompositeIndex()

When JanusGraph upserts the property name for ANY vertex, it has to check the label of that vertex. This OFTEN leads to a backend call because the label of that vertex is not cached, even if fast-property=true (again, I am not 100% sure but that's what I remember).

This is not really part of this PR per se, but I just want to bring this issue to your attention since you are working on this area.

As far as I can tell, vertex label is stored as an edge and not a property. I could be wrong so, but whenever we call AbstractVertex.label method it uses the next backend call:
‘’’
queryBuilder.noPartitionRestriction().type(BaseLabel.VertexLabelEdge).direction(Direction.OUT);
‘’’
As I understand it retrieves OUT edge with the VertexLabelEdge label.

Thus, I’m not sure we can fetch properties and the label edge via a single slice query. Unless we are sure that VertexLabelEdge is placed near the properties in the row (not sure how to check that) then we will need two slice queries to retrieve vertex properties and the vertex label.

I have added multi-query optimisation to retrieve vertex labels to steps:
‘hasLabel’ (this was added in the previous PR), ‘valueMap().with(WithOptions.tokens, WithOptions.label)’, and ‘elementMap()’. These steps use an additional multi-query to retrieve vertex labels in batches.
I also have plans to add multi-query optimisation to Gremlin ‘label’ step (‘g.V().label()’), but it has a small challenge because LabelStep in TinkerPop is ‘final’. Thus, we need to remove ‘final’ keyword first in TinkerPop itself. Nevertheless, it won’t be a part of this PR, but I will create a separate ticket.

The issue you shared is not fully related to multi-query optimisation, but I totally agree that it does make sense to cache vertex label instead of firing a new query each time.
For valueMap and elementMap steps you may see that I evaluate vertex labels (when they are required) for a batch of vertices and then store all labels for a current batch in the Map<JanusGraphVertex, String>.
For foldable ‘has’ steps the logic relies on transaction cache instead. We are using multi-query (not bigger than the transaction cache) and immediately evaluate the result which reuses transaction cache data. We always evaluate hasId first (no backend calls), if hasId passed, we evaluate hasLabel then (first multi-query), if hasLabel passed, we evaluate ‘has’ property conditions (second multi-query). The result is cached for a current batch in Map<JanusGraphVertex, Boolean>, where Boolean means vertex passed or not passed all conditions.

Thus, for hasLabel, valueMap, elementMap steps - we are prefetching vertex labels and no additional caching is needed for these steps.
Nevertheless, as I mentioned above, I totally agree that it does make sense to cache vertex labels, but I haven’t looked in that direction yet. All I can tell is that vertex fetching slice query is going to be cached in the transaction cache, but if transaction cache is small, the result might be evicted from the cache which will result to a separate backend call whenever we need that vertex label again.
I also agree that we need to add multi-query vertex label prefetching to other steps. An obvious step is ‘label’ (mentioned above), but another one could be .property step (‘g.V().property(“name”, “foo”)’) which implies to the upsert case you referred above (when an upsert is touching an index constrained to a vertex label).

I don’t think improved vertex label caching or label multi-query optimisation for other steps (other than valueMap or elementMap) are going to be part of this PR, but I agree we need to take a closer look at them and implement those additional optimisations.

P.S. ‘fast-property=true’ is applicable to vertex properties only, and not to a label. Thus, you are right that vertex labels are not fetched and / or cached with ‘fast-property=true’.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the detailed explanation, @porunov! I agree that changing this is out of scope for this PR. This was mostly a question for my own understanding.
We could maybe add a short explanation to the docs section about batch processing to make sure that uses are aware of the trade off.

Copy link
Member Author

@porunov porunov Jun 12, 2023

Choose a reason for hiding this comment

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

Thanks for the detailed explanation, @porunov! I agree that changing this is out of scope for this PR. This was mostly a question for my own understanding.
We could maybe add a short explanation to the docs section about batch processing to make sure that uses are aware of the trade off.

The explanation doc makes sense, but I’m not sure that it should be a part of a batch processing doc because it’s related to JanusGraph datastructure more and the logic is applicable with both enabled and disabled batch processing.
Nevertheless, I think it makes sense to open a separate docs improvement issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

Docs improvement issue: #3814

Copy link
Member Author

Choose a reason for hiding this comment

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

Taking into consideration that the query batch modes are part of query.batch configuration namespace, I'm now thinking it actually makes sense to add that explanation under the Batch processing documentation as @FlorianHockmann suggested.
I added it at the end of batch-processing.md

Copy link
Member Author

Choose a reason for hiding this comment

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

This sounds to me like I'm getting a better performance with all_properties in this example, but then I have to accept the downside that I will also fetch properties for other traversals that I don't need if I for example only want one specific property there. Is that correct?

It's correct as for now. I.e. when multi-query is enabled then g.V(v1,v2,v3,v4,v5).values("prop1", "prop2", "prop3") will execute 3 separate queries for provided vertices (v1, v2, v3, v4, v5). Moreover, current multi-query cannot execute several slice queries together. Instead is executes them one by one (awaiting until the previous query is fully finished). The behavior is the same in master branch and in this PR for required_properties_only mode. However this PR also adds all_properties which fetches all vertex properties using a single slice query.

As for now I can say - you are correct. You will get much better performance with all_properties instead of required_properties_only (not applicable to master branch because master branch currently always work in required_properties_only mode).
However, you will get worse performance not because of the fact that you need to execute 10 CQL queries instead of 1 CQL query, but due to the fact that those 10 queries are executed sequentially. In case they are executed in parallel - the performance difference between executing 1 CQL query or 100 CQL queries will most likely be negligible to none (in case connection channels are not overloaded).

Thus, I started working on #3825 . This will allow storage implementations to execute slice queries of multi-query however they like. I currently added CQL storage driver optimization to execute all slice queries of multi-query in parallel instead of sequentially. This should significantly improve performance cases when multiple slice queries are needed to evaluate multi-query (like the example above g.V(v1,v2,v3,v4,v5).values("prop1", "prop2", "prop3")).
After #3825 - the situation will change and required_properties_only might actually work faster than all_properties in many cases.

Moreover, after we implement with #3816 then required_properties_only will probably be a better choice in most of the cases. After that all_properties will be beneficial only in some very specific cases when pre-fetching of all properties into the transaction cache is beneficial for next steps evaluation.

Copy link
Member

@li-boxuan li-boxuan Jun 15, 2023

Choose a reason for hiding this comment

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

Thus, I’m not sure we can fetch properties and the label edge via a single slice query. Unless we are sure that VertexLabelEdge is placed near the properties in the row (not sure how to check that) then we will need two slice queries to retrieve vertex properties and the vertex label.

Agree this is out of the scope of this PR. In order to check that, you can call .label.profile() and see the backend call. A property falls in the range [0x40, 0x60) while an edge falls in the range [0x60, 0x80). I don't remember what 0x60 stands for, but if it happens to be the label, then we could include it when fetching all properties.

UPDATE: I take that back, the profiler does not show the backend call for the label step.

UPDATE: I took a quick look and seems the query for label is [0x24, 0x25), so it seems okay to fetch label together with properties.

@porunov porunov force-pushed the feature/property-map-multi-query branch from 4ee27d0 to a3bb658 Compare June 9, 2023 14:38
@porunov
Copy link
Member Author

porunov commented Jun 9, 2023

@JanusGraph/committers In case anyone wants to have an introduction call into this PR (or explanation of #3244 ), so that it would be easier to review it, please, ping me here or in Discord to setup a call. I think I could walk over the PR quickly to explain this optimization.

@porunov
Copy link
Member Author

porunov commented Jun 9, 2023

Benchmark results

Master branch (the same CQLMultiQueryPropertiesBenchmark benchmarks but without propertiesBatchMode because there are not such modes in master branch).

Benchmark                                                                       (fastProperty)  (verticesAmount)  Mode  Cnt     Score     Error  Units
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true              5000  avgt    5   964.272 ±  87.347  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true             50000  avgt    5  9892.061 ± 352.958  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false              5000  avgt    5   957.383 ±  50.335  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false             50000  avgt    5  9551.451 ± 547.701  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true              5000  avgt    5   957.706 ±  61.403  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true             50000  avgt    5  9640.378 ± 446.481  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false              5000  avgt    5   845.684 ±  67.494  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false             50000  avgt    5  8471.285 ± 493.068  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true              5000  avgt    5    65.450 ±   2.761  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true             50000  avgt    5   704.065 ±  32.208  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false              5000  avgt    5    65.956 ±   1.719  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false             50000  avgt    5   723.837 ±  57.433  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true              5000  avgt    5    33.796 ±   1.583  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true             50000  avgt    5   356.716 ±  18.529  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false              5000  avgt    5    33.873 ±   1.865  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false             50000  avgt    5   354.061 ±  17.252  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true              5000  avgt    5   557.451 ±  35.064  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true             50000  avgt    5  5787.264 ± 583.634  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false              5000  avgt    5   551.946 ±  21.817  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false             50000  avgt    5  5662.712 ± 463.439  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true              5000  avgt    5   526.930 ±  30.550  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true             50000  avgt    5  5570.636 ± 473.214  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false              5000  avgt    5   441.264 ±  24.639  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false             50000  avgt    5  4460.889 ± 118.849  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true              5000  avgt    5   542.081 ±  38.012  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true             50000  avgt    5  5685.393 ± 885.892  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false              5000  avgt    5   569.407 ±  44.710  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false             50000  avgt    5  5592.814 ± 718.038  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true              5000  avgt    5   558.271 ±  30.460  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true             50000  avgt    5  5606.203 ± 916.021  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false              5000  avgt    5   439.660 ±  19.445  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false             50000  avgt    5  4448.594 ± 313.873  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true              5000  avgt    5   957.822 ±  50.508  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true             50000  avgt    5  9672.481 ± 563.403  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false              5000  avgt    5   949.788 ±  21.407  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false             50000  avgt    5  9625.796 ± 353.552  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true              5000  avgt    5   476.663 ±  40.165  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true             50000  avgt    5   484.423 ±  25.171  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false              5000  avgt    5   480.072 ±  28.836  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false             50000  avgt    5   498.064 ± 114.490  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true              5000  avgt    5     0.358 ±   0.059  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true             50000  avgt    5     0.363 ±   0.072  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false              5000  avgt    5     0.357 ±   0.088  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false             50000  avgt    5     0.365 ±   0.066  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true              5000  avgt    5    67.361 ±   6.578  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true             50000  avgt    5   706.912 ±  47.389  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false              5000  avgt    5    68.361 ±   5.131  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false             50000  avgt    5   775.302 ±  95.093  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true              5000  avgt    5    36.557 ±   4.165  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true             50000  avgt    5   379.198 ±  61.616  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false              5000  avgt    5    38.225 ±   1.804  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false             50000  avgt    5   377.896 ±  49.343  ms/op

Current PR (CQLMultiQueryPropertiesBenchmark benchmark).

Benchmark                                                                       (fastProperty)     (propertiesBatchMode)  (verticesAmount)  Mode  Cnt     Score     Error  Units
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true            all_properties              5000  avgt    5    93.383 ±   1.783  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true            all_properties             50000  avgt    5   997.559 ±  33.413  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true  required_properties_only              5000  avgt    5    91.060 ±   2.382  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true  required_properties_only             50000  avgt    5   991.725 ±  47.729  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true                      none              5000  avgt    5   980.330 ±  65.645  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true                      none             50000  avgt    5  9793.818 ± 350.201  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false            all_properties              5000  avgt    5    91.221 ±   6.838  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false            all_properties             50000  avgt    5   966.565 ±  35.235  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false  required_properties_only              5000  avgt    5    92.143 ±   6.738  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false  required_properties_only             50000  avgt    5   970.592 ±  30.075  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false                      none              5000  avgt    5   979.935 ±  62.191  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false                      none             50000  avgt    5  9783.646 ± 684.813  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true            all_properties              5000  avgt    5    90.478 ±   7.197  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true            all_properties             50000  avgt    5   963.952 ±  15.322  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true  required_properties_only              5000  avgt    5    60.786 ±  10.340  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true  required_properties_only             50000  avgt    5   624.729 ±  55.330  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true                      none              5000  avgt    5   975.190 ±  62.482  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true                      none             50000  avgt    5  9653.585 ± 689.044  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false            all_properties              5000  avgt    5    91.281 ±   8.611  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false            all_properties             50000  avgt    5   995.726 ±  46.745  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false  required_properties_only              5000  avgt    5    60.595 ±   3.755  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false  required_properties_only             50000  avgt    5   640.938 ±  63.108  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false                      none              5000  avgt    5   852.743 ±  30.374  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false                      none             50000  avgt    5  8580.788 ± 343.474  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true            all_properties              5000  avgt    5    64.210 ±   2.644  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true            all_properties             50000  avgt    5   692.667 ±  22.056  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true  required_properties_only              5000  avgt    5    65.601 ±   1.998  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true  required_properties_only             50000  avgt    5   702.207 ±  10.298  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true                      none              5000  avgt    5   577.712 ±  42.967  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true                      none             50000  avgt    5  5728.894 ± 340.499  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false            all_properties              5000  avgt    5    64.431 ±   2.441  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false            all_properties             50000  avgt    5   695.171 ±  26.669  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false  required_properties_only              5000  avgt    5    65.174 ±   1.879  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false  required_properties_only             50000  avgt    5   704.267 ±  81.397  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false                      none              5000  avgt    5   563.392 ±  35.075  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false                      none             50000  avgt    5  5753.766 ± 388.733  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true            all_properties              5000  avgt    5    62.307 ±   2.951  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true            all_properties             50000  avgt    5   720.527 ±  41.018  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true  required_properties_only              5000  avgt    5    33.688 ±   1.603  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true  required_properties_only             50000  avgt    5   355.029 ±  27.431  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true                      none              5000  avgt    5   551.301 ±  27.813  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true                      none             50000  avgt    5  5666.774 ± 520.180  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false            all_properties              5000  avgt    5    66.289 ±   2.900  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false            all_properties             50000  avgt    5   668.433 ±  16.470  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false  required_properties_only              5000  avgt    5    33.668 ±   1.324  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false  required_properties_only             50000  avgt    5   355.872 ±  19.185  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false                      none              5000  avgt    5   446.397 ±  33.309  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false                      none             50000  avgt    5  4439.918 ± 124.419  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true            all_properties              5000  avgt    5    71.899 ±   2.596  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true            all_properties             50000  avgt    5   769.822 ±  33.914  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true  required_properties_only              5000  avgt    5    72.379 ±   1.941  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true  required_properties_only             50000  avgt    5   732.065 ±  16.825  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true                      none              5000  avgt    5   559.723 ±  72.221  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true                      none             50000  avgt    5  5685.405 ± 366.907  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false            all_properties              5000  avgt    5    66.805 ±   1.739  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false            all_properties             50000  avgt    5   778.334 ±  20.116  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false  required_properties_only              5000  avgt    5    72.734 ±   2.363  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false  required_properties_only             50000  avgt    5   814.121 ± 151.232  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false                      none              5000  avgt    5   599.049 ±  84.883  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false                      none             50000  avgt    5  5996.871 ± 498.959  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true            all_properties              5000  avgt    5    70.520 ±   3.452  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true            all_properties             50000  avgt    5   758.868 ±  19.747  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true  required_properties_only              5000  avgt    5    39.731 ±   2.113  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true  required_properties_only             50000  avgt    5   426.829 ±  21.454  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true                      none              5000  avgt    5   564.335 ±  19.601  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true                      none             50000  avgt    5  5951.122 ± 465.328  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false            all_properties              5000  avgt    5    71.804 ±  10.296  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false            all_properties             50000  avgt    5   820.122 ±  10.254  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false  required_properties_only              5000  avgt    5    37.993 ±   1.959  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false  required_properties_only             50000  avgt    5   384.550 ±  24.641  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false                      none              5000  avgt    5   442.692 ±  16.803  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false                      none             50000  avgt    5  4501.340 ± 138.084  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true            all_properties              5000  avgt    5    70.487 ±   1.983  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true            all_properties             50000  avgt    5   752.842 ±  10.761  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true  required_properties_only              5000  avgt    5    71.008 ±   3.104  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true  required_properties_only             50000  avgt    5   764.884 ±  21.195  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true                      none              5000  avgt    5   571.039 ±  54.164  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true                      none             50000  avgt    5  5609.491 ± 389.210  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false            all_properties              5000  avgt    5    70.420 ±   2.010  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false            all_properties             50000  avgt    5   761.669 ±  22.256  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false  required_properties_only              5000  avgt    5    72.959 ±   1.509  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false  required_properties_only             50000  avgt    5   764.807 ±  14.895  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false                      none              5000  avgt    5   576.053 ±  51.353  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false                      none             50000  avgt    5  5557.885 ± 442.356  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true            all_properties              5000  avgt    5    64.963 ±   3.166  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true            all_properties             50000  avgt    5   704.913 ±  16.920  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true  required_properties_only              5000  avgt    5    36.532 ±   1.394  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true  required_properties_only             50000  avgt    5   395.454 ±  17.855  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true                      none              5000  avgt    5   554.380 ±  52.618  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true                      none             50000  avgt    5  5624.914 ± 528.845  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false            all_properties              5000  avgt    5    65.221 ±   2.002  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false            all_properties             50000  avgt    5   711.560 ±  27.398  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false  required_properties_only              5000  avgt    5    37.448 ±   1.415  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false  required_properties_only             50000  avgt    5   390.785 ±  18.943  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false                      none              5000  avgt    5   445.607 ±  16.537  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false                      none             50000  avgt    5  4509.177 ± 219.712  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true            all_properties              5000  avgt    5    94.949 ±   6.048  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true            all_properties             50000  avgt    5  1035.012 ±  46.590  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true  required_properties_only              5000  avgt    5    95.563 ±   1.864  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true  required_properties_only             50000  avgt    5   972.388 ±  49.622  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true                      none              5000  avgt    5   976.642 ±  84.795  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true                      none             50000  avgt    5  9655.548 ± 394.002  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false            all_properties              5000  avgt    5    94.174 ±   4.177  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false            all_properties             50000  avgt    5  1023.569 ±  28.743  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false  required_properties_only              5000  avgt    5    96.558 ±   4.535  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false  required_properties_only             50000  avgt    5  1025.396 ±  68.314  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false                      none              5000  avgt    5   957.681 ±  43.520  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false                      none             50000  avgt    5  9727.715 ± 355.927  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true            all_properties              5000  avgt    5    49.762 ±   2.935  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true            all_properties             50000  avgt    5    47.708 ±   2.521  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true  required_properties_only              5000  avgt    5    48.467 ±   2.330  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true  required_properties_only             50000  avgt    5    49.909 ±   1.563  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true                      none              5000  avgt    5   484.785 ±  58.749  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true                      none             50000  avgt    5   491.493 ±  35.335  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false            all_properties              5000  avgt    5    48.798 ±   2.334  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false            all_properties             50000  avgt    5    47.810 ±   1.514  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false  required_properties_only              5000  avgt    5    49.163 ±   1.002  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false  required_properties_only             50000  avgt    5    47.823 ±   1.979  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false                      none              5000  avgt    5   484.910 ±  33.470  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false                      none             50000  avgt    5   574.051 ± 248.606  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true            all_properties              5000  avgt    5     0.428 ±   0.120  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true            all_properties             50000  avgt    5     0.425 ±   0.058  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true  required_properties_only              5000  avgt    5     0.416 ±   0.093  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true  required_properties_only             50000  avgt    5     0.420 ±   0.086  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true                      none              5000  avgt    5     0.405 ±   0.095  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true                      none             50000  avgt    5     0.392 ±   0.105  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false            all_properties              5000  avgt    5     0.422 ±   0.064  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false            all_properties             50000  avgt    5     0.417 ±   0.101  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false  required_properties_only              5000  avgt    5     0.422 ±   0.076  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false  required_properties_only             50000  avgt    5     0.419 ±   0.075  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false                      none              5000  avgt    5     0.379 ±   0.083  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false                      none             50000  avgt    5     0.382 ±   0.114  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true            all_properties              5000  avgt    5    66.044 ±   3.040  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true            all_properties             50000  avgt    5   716.190 ±  10.074  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true  required_properties_only              5000  avgt    5    66.181 ±   1.998  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true  required_properties_only             50000  avgt    5   716.719 ±  38.830  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true                      none              5000  avgt    5   560.275 ±  48.520  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true                      none             50000  avgt    5  5693.016 ± 762.507  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false            all_properties              5000  avgt    5    65.653 ±   2.783  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false            all_properties             50000  avgt    5   706.485 ±  29.865  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false  required_properties_only              5000  avgt    5    66.968 ±   2.563  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false  required_properties_only             50000  avgt    5   710.947 ±  11.166  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false                      none              5000  avgt    5   553.067 ±  52.259  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false                      none             50000  avgt    5  5609.014 ± 432.180  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true            all_properties              5000  avgt    5    62.031 ±   2.234  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true            all_properties             50000  avgt    5   660.017 ±   9.236  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true  required_properties_only              5000  avgt    5    34.097 ±   0.723  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true  required_properties_only             50000  avgt    5   361.016 ±  24.992  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true                      none              5000  avgt    5   559.019 ±  28.881  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true                      none             50000  avgt    5  5757.632 ± 672.626  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false            all_properties              5000  avgt    5    61.147 ±   3.310  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false            all_properties             50000  avgt    5   661.413 ±  11.374  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false  required_properties_only              5000  avgt    5    33.717 ±   1.688  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false  required_properties_only             50000  avgt    5   359.730 ±  18.505  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false                      none              5000  avgt    5   441.484 ±  56.556  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false                      none             50000  avgt    5  4432.115 ± 151.813  ms/op

Conclusion:
For valueMap(), propertyMap(), and elementMap() cases the performance is ~10 times better in this PR than in master branch. This is expected because there is no multi-query support for these steps in master branch.
As we see properties() and values() performance stayed the same. This is also expected because these steps have multi-query support in master branch.

What is missed in the above benchmarks? I realized that I wanted to show performance difference for cases when user wants to retrieve multiple properties (like ~5 properties) with modes required_properties_only and all_properties. I expect all_properties to have better performance than required_properties_only for such cases. I will add that benchmark case soon as well.

@porunov porunov force-pushed the feature/property-map-multi-query branch from a3bb658 to 5240e3b Compare June 10, 2023 14:26
@porunov
Copy link
Member Author

porunov commented Jun 10, 2023

New benchmark of this PR.

This benchmark is the similar to the above benchmark, but has the next changes:

  • The logic of all_properties mode for values, properties, valueMap, propertyMap, elementMap steps is now behaves the same as required_properties_only mode in case a single property key is requested. I think in most cases users would prefer fetching just one property instead of pre-fetching all properties when a single property is requested. Of course, if the user requests more than a single property (but not all properties), then JanusGraph can't perform a single slice operation to retrieve only requested properties. Thus, the appropriate mode will be used when more than one property explicitly requested (i.e. all_properties via a single slice operation or required_properties_only via separate slice operations per property. See this comment explaining why JanusGraph can't retrieve multiple explicitly selected properties via a single slice operation). Now you can see that benchmark tests getElementMapSingleProperty, getPropertiesSingleProperty, getPropertyMapSingleProperty, getValueMapSingleProperty, and getValuesSingleProperty have the same performance both for all_properties mode and required_properties_only mode.
  • The new added tests getValuesMultipleProperties, getValueMapMultipleProperties, getElementMapMultipleProperties show the performance difference of all_properties mode and required_properties_only mode when 5 normal String properties are requested. In this situation it shows that all_properties mode which retrieves 10 properties via a single slice query (5 needed properties and 5 redundant properties) performs about 2 times faster than required_properties_only which retrieves those properties via 5 separate slice queries. This is a trade off which user needs to make right now (either retrieving all properties via less queries or only needed properties via more queries).
Benchmark                                                                       (fastProperty)     (propertiesBatchMode)  (verticesAmount)  Mode  Cnt      Score      Error  Units
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true            all_properties              5000  avgt    5    112.508 ±   11.075  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true            all_properties             50000  avgt    5   1174.113 ±   43.722  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true  required_properties_only              5000  avgt    5    106.561 ±    3.294  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true  required_properties_only             50000  avgt    5   1133.707 ±   48.611  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true                      none              5000  avgt    5   1429.018 ± 2746.758  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true                      none             50000  avgt    5  10061.642 ± 1995.675  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false            all_properties              5000  avgt    5    111.084 ±   19.997  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false            all_properties             50000  avgt    5   1109.924 ±   28.066  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false  required_properties_only              5000  avgt    5     98.326 ±    1.278  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false  required_properties_only             50000  avgt    5   1111.029 ±   67.416  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false                      none              5000  avgt    5    969.898 ±   81.713  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false                      none             50000  avgt    5   9888.775 ±  839.134  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true            all_properties              5000  avgt    5     96.740 ±    4.691  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true            all_properties             50000  avgt    5   1117.944 ±   52.606  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true  required_properties_only              5000  avgt    5    177.208 ±   12.195  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true  required_properties_only             50000  avgt    5   1914.517 ±   81.878  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true                      none              5000  avgt    5   2559.617 ±   97.126  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true                      none             50000  avgt    5  25764.195 ±  579.301  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false            all_properties              5000  avgt    5     97.931 ±    3.235  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false            all_properties             50000  avgt    5   1106.606 ±   35.571  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false  required_properties_only              5000  avgt    5    173.672 ±    8.143  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false  required_properties_only             50000  avgt    5   1914.555 ±   40.319  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false                      none              5000  avgt    5   2551.317 ±  115.354  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false                      none             50000  avgt    5  25627.104 ±  631.340  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true            all_properties              5000  avgt    5     71.126 ±    6.730  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true            all_properties             50000  avgt    5    733.283 ±   62.928  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true  required_properties_only              5000  avgt    5     71.516 ±    5.518  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true  required_properties_only             50000  avgt    5    726.940 ±   62.089  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true                      none              5000  avgt    5    948.140 ±   43.905  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true                      none             50000  avgt    5   9682.842 ±  240.244  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false            all_properties              5000  avgt    5     63.151 ±    3.449  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false            all_properties             50000  avgt    5    746.233 ±   60.015  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false  required_properties_only              5000  avgt    5     67.547 ±    3.012  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false  required_properties_only             50000  avgt    5    736.679 ±   19.321  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false                      none              5000  avgt    5    840.850 ±   47.270  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false                      none             50000  avgt    5   8539.786 ±  328.621  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true            all_properties              5000  avgt    5     66.394 ±    2.767  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true            all_properties             50000  avgt    5    715.651 ±   36.472  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true  required_properties_only              5000  avgt    5     66.786 ±    3.565  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true  required_properties_only             50000  avgt    5    713.804 ±   24.074  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true                      none              5000  avgt    5    563.765 ±   44.608  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true                      none             50000  avgt    5   5647.260 ±  346.750  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false            all_properties              5000  avgt    5     65.783 ±    2.042  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false            all_properties             50000  avgt    5    716.880 ±   22.626  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false  required_properties_only              5000  avgt    5     67.402 ±    2.065  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false  required_properties_only             50000  avgt    5    726.351 ±   25.015  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false                      none              5000  avgt    5    562.083 ±   43.534  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false                      none             50000  avgt    5   5714.483 ±  705.249  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true            all_properties              5000  avgt    5     34.634 ±    2.826  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true            all_properties             50000  avgt    5    369.115 ±   15.382  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true  required_properties_only              5000  avgt    5     34.778 ±    2.197  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true  required_properties_only             50000  avgt    5    363.830 ±   22.438  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true                      none              5000  avgt    5    550.201 ±   36.246  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true                      none             50000  avgt    5   5442.111 ±  336.614  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false            all_properties              5000  avgt    5     33.848 ±    1.854  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false            all_properties             50000  avgt    5    365.017 ±   26.860  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false  required_properties_only              5000  avgt    5     35.951 ±    1.832  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false  required_properties_only             50000  avgt    5    362.678 ±   20.134  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false                      none              5000  avgt    5    444.267 ±   22.357  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false                      none             50000  avgt    5   4455.047 ±  174.407  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true            all_properties              5000  avgt    5     72.060 ±    2.588  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true            all_properties             50000  avgt    5    768.321 ±   11.416  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true  required_properties_only              5000  avgt    5     72.868 ±    1.820  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true  required_properties_only             50000  avgt    5    777.575 ±   23.102  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true                      none              5000  avgt    5    544.030 ±   50.712  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true                      none             50000  avgt    5   5642.992 ±  438.513  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false            all_properties              5000  avgt    5     72.305 ±    8.886  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false            all_properties             50000  avgt    5    794.832 ±   29.684  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false  required_properties_only              5000  avgt    5     74.251 ±    2.240  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false  required_properties_only             50000  avgt    5    785.073 ±   15.800  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false                      none              5000  avgt    5    550.477 ±   78.978  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false                      none             50000  avgt    5   5765.941 ±  349.383  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true            all_properties              5000  avgt    5     36.827 ±    1.900  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true            all_properties             50000  avgt    5    409.173 ±   16.507  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true  required_properties_only              5000  avgt    5     38.029 ±    1.846  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true  required_properties_only             50000  avgt    5    395.867 ±   17.348  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true                      none              5000  avgt    5    564.012 ±   40.926  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true                      none             50000  avgt    5   5770.243 ±  234.055  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false            all_properties              5000  avgt    5     38.020 ±    2.442  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false            all_properties             50000  avgt    5    403.486 ±   20.286  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false  required_properties_only              5000  avgt    5     37.136 ±    1.291  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false  required_properties_only             50000  avgt    5    405.910 ±   18.181  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false                      none              5000  avgt    5    451.445 ±   65.801  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false                      none             50000  avgt    5   4554.785 ±  258.574  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true            all_properties              5000  avgt    5     71.910 ±    2.263  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true            all_properties             50000  avgt    5    772.882 ±   19.546  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true  required_properties_only              5000  avgt    5     73.669 ±    1.260  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true  required_properties_only             50000  avgt    5    722.936 ±    5.275  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true                      none              5000  avgt    5    563.968 ±   32.223  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true                      none             50000  avgt    5   5528.944 ±  386.294  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false            all_properties              5000  avgt    5     71.751 ±    2.290  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false            all_properties             50000  avgt    5    773.763 ±   47.943  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false  required_properties_only              5000  avgt    5     71.967 ±    2.767  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false  required_properties_only             50000  avgt    5    786.568 ±   32.199  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false                      none              5000  avgt    5    551.627 ±   65.933  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false                      none             50000  avgt    5   5618.338 ± 1266.114  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true            all_properties              5000  avgt    5     66.278 ±    1.920  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true            all_properties             50000  avgt    5    725.242 ±   40.793  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true  required_properties_only              5000  avgt    5    143.680 ±    4.334  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true  required_properties_only             50000  avgt    5   1541.203 ±   75.440  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true                      none              5000  avgt    5   2140.702 ±   70.616  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true                      none             50000  avgt    5  21578.656 ±  148.698  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false            all_properties              5000  avgt    5     67.668 ±    5.084  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false            all_properties             50000  avgt    5    715.138 ±   18.876  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false  required_properties_only              5000  avgt    5    141.957 ±    5.046  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false  required_properties_only             50000  avgt    5   1477.101 ±   52.884  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false                      none              5000  avgt    5   2151.385 ±  108.209  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false                      none             50000  avgt    5  21587.960 ±  758.034  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true            all_properties              5000  avgt    5     38.572 ±    2.411  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true            all_properties             50000  avgt    5    406.296 ±   21.827  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true  required_properties_only              5000  avgt    5     38.458 ±    2.280  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true  required_properties_only             50000  avgt    5    402.473 ±   15.259  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true                      none              5000  avgt    5    547.396 ±   19.911  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true                      none             50000  avgt    5   5548.655 ±  239.858  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false            all_properties              5000  avgt    5     37.269 ±    1.637  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false            all_properties             50000  avgt    5    402.149 ±   22.942  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false  required_properties_only              5000  avgt    5     37.645 ±    1.445  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false  required_properties_only             50000  avgt    5    402.665 ±   25.860  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false                      none              5000  avgt    5    440.242 ±   28.040  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false                      none             50000  avgt    5   4483.891 ±  282.429  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true            all_properties              5000  avgt    5     99.181 ±    8.287  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true            all_properties             50000  avgt    5    995.448 ±   63.970  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true  required_properties_only              5000  avgt    5     99.983 ±    6.179  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true  required_properties_only             50000  avgt    5    994.085 ±   37.992  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true                      none              5000  avgt    5    972.822 ±   46.729  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true                      none             50000  avgt    5   9869.285 ±  968.073  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false            all_properties              5000  avgt    5     97.836 ±    5.018  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false            all_properties             50000  avgt    5    994.906 ±   61.186  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false  required_properties_only              5000  avgt    5     98.677 ±    2.942  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false  required_properties_only             50000  avgt    5   1036.557 ±   21.138  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false                      none              5000  avgt    5    958.392 ±   45.965  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false                      none             50000  avgt    5   9815.057 ±  518.332  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true            all_properties              5000  avgt    5     49.115 ±    3.525  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true            all_properties             50000  avgt    5     50.530 ±    1.798  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true  required_properties_only              5000  avgt    5     49.422 ±    2.263  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true  required_properties_only             50000  avgt    5     51.261 ±    2.109  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true                      none              5000  avgt    5    482.369 ±    9.957  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true                      none             50000  avgt    5    487.373 ±   27.977  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false            all_properties              5000  avgt    5     49.398 ±    3.189  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false            all_properties             50000  avgt    5     50.871 ±    1.800  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false  required_properties_only              5000  avgt    5     50.618 ±    2.332  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false  required_properties_only             50000  avgt    5     48.282 ±    1.552  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false                      none              5000  avgt    5    482.262 ±   50.532  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false                      none             50000  avgt    5    488.641 ±   36.088  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true            all_properties              5000  avgt    5      0.426 ±    0.092  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true            all_properties             50000  avgt    5      0.428 ±    0.101  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true  required_properties_only              5000  avgt    5      0.424 ±    0.096  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true  required_properties_only             50000  avgt    5      0.427 ±    0.084  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true                      none              5000  avgt    5      0.383 ±    0.057  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true                      none             50000  avgt    5      0.390 ±    0.080  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false            all_properties              5000  avgt    5      0.437 ±    0.131  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false            all_properties             50000  avgt    5      0.424 ±    0.107  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false  required_properties_only              5000  avgt    5      0.423 ±    0.108  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false  required_properties_only             50000  avgt    5      0.425 ±    0.097  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false                      none              5000  avgt    5      0.390 ±    0.096  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false                      none             50000  avgt    5      0.393 ±    0.079  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true            all_properties              5000  avgt    5     65.367 ±    3.038  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true            all_properties             50000  avgt    5    720.311 ±   24.342  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true  required_properties_only              5000  avgt    5     66.256 ±    3.546  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true  required_properties_only             50000  avgt    5    724.915 ±   13.225  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true                      none              5000  avgt    5    568.292 ±   68.199  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true                      none             50000  avgt    5   5747.026 ±  586.748  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false            all_properties              5000  avgt    5     66.476 ±    4.264  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false            all_properties             50000  avgt    5    708.272 ±   43.057  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false  required_properties_only              5000  avgt    5     66.873 ±    2.242  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false  required_properties_only             50000  avgt    5    706.213 ±   24.491  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false                      none              5000  avgt    5    554.654 ±   74.316  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false                      none             50000  avgt    5   5662.971 ±  564.566  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true            all_properties              5000  avgt    5     62.513 ±    1.902  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true            all_properties             50000  avgt    5    740.192 ±   29.389  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true  required_properties_only              5000  avgt    5    139.351 ±    7.877  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true  required_properties_only             50000  avgt    5   1428.442 ±   45.438  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true                      none              5000  avgt    5   2131.716 ±   67.587  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true                      none             50000  avgt    5  21719.438 ± 1159.021  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false            all_properties              5000  avgt    5     62.789 ±    3.300  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false            all_properties             50000  avgt    5    681.390 ±   16.083  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false  required_properties_only              5000  avgt    5    138.545 ±    7.993  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false  required_properties_only             50000  avgt    5   1442.910 ±   73.042  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false                      none              5000  avgt    5   2169.044 ±  169.800  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false                      none             50000  avgt    5  21765.379 ±  503.634  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true            all_properties              5000  avgt    5     34.284 ±    2.642  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true            all_properties             50000  avgt    5    364.749 ±   21.167  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true  required_properties_only              5000  avgt    5     34.846 ±    1.591  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true  required_properties_only             50000  avgt    5    357.964 ±   14.473  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true                      none              5000  avgt    5    522.593 ±   54.275  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true                      none             50000  avgt    5   5662.318 ±  773.211  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false            all_properties              5000  avgt    5     33.853 ±    1.276  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false            all_properties             50000  avgt    5    358.640 ±   12.190  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false  required_properties_only              5000  avgt    5     34.711 ±    1.189  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false  required_properties_only             50000  avgt    5    361.955 ±   21.804  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false                      none              5000  avgt    5    444.817 ±   52.250  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false                      none             50000  avgt    5   4448.250 ±   89.129  ms/op

@porunov porunov force-pushed the feature/property-map-multi-query branch from 5240e3b to c7423c6 Compare June 12, 2023 19:02
@porunov
Copy link
Member Author

porunov commented Jun 13, 2023

Refactored JanusGraphElementMapStep and JanusGraphPropertyMapStep to have slightly less overhead which resulted in a tiny bit better performance for valueMap / propertyMap steps (about 5-6% improvment) and elementMap step (about 15% improvement).
All other benchmarks are the same as above.

Current benchmark is below:

Benchmark                                                                       (fastProperty)     (propertiesBatchMode)  (verticesAmount)  Mode  Cnt      Score     Error  Units
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true            all_properties              5000  avgt    5     91.986 ±   2.934  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true            all_properties             50000  avgt    5    993.552 ±  43.812  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true  required_properties_only              5000  avgt    5     92.582 ±   4.400  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true  required_properties_only             50000  avgt    5   1000.262 ±  33.845  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true                      none              5000  avgt    5    971.530 ±  60.427  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                            true                      none             50000  avgt    5   9788.977 ± 260.907  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false            all_properties              5000  avgt    5     92.638 ±   5.105  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false            all_properties             50000  avgt    5    978.082 ±  49.127  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false  required_properties_only              5000  avgt    5     92.210 ±   3.185  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false  required_properties_only             50000  avgt    5    954.413 ±  26.251  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false                      none              5000  avgt    5    973.237 ± 110.174  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMap                                           false                      none             50000  avgt    5   9785.117 ± 598.547  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true            all_properties              5000  avgt    5     88.490 ±   5.019  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true            all_properties             50000  avgt    5    959.032 ±  44.416  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true  required_properties_only              5000  avgt    5    161.725 ±   7.118  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true  required_properties_only             50000  avgt    5   1722.942 ±  95.215  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true                      none              5000  avgt    5   2544.682 ± 145.111  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                          true                      none             50000  avgt    5  25925.504 ± 941.722  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false            all_properties              5000  avgt    5     89.656 ±   5.751  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false            all_properties             50000  avgt    5   1007.143 ±  21.086  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false  required_properties_only              5000  avgt    5    165.005 ±   6.402  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false  required_properties_only             50000  avgt    5   1702.390 ±  59.130  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false                      none              5000  avgt    5   2559.412 ±  64.792  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapMultipleProperties                         false                      none             50000  avgt    5  25735.187 ± 429.041  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true            all_properties              5000  avgt    5     57.990 ±   4.265  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true            all_properties             50000  avgt    5    636.145 ±  51.094  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true  required_properties_only              5000  avgt    5     61.035 ±   2.646  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true  required_properties_only             50000  avgt    5    636.101 ±  40.574  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true                      none              5000  avgt    5    956.378 ±  88.873  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                              true                      none             50000  avgt    5   9646.207 ± 181.058  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false            all_properties              5000  avgt    5     58.791 ±   5.734  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false            all_properties             50000  avgt    5    636.069 ±  57.609  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false  required_properties_only              5000  avgt    5     59.819 ±   2.789  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false  required_properties_only             50000  avgt    5    638.381 ±  41.545  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false                      none              5000  avgt    5    853.335 ±  85.659  ms/op
CQLMultiQueryPropertiesBenchmark.getElementMapSingleProperty                             false                      none             50000  avgt    5   8596.767 ± 192.771  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true            all_properties              5000  avgt    5     65.649 ±   2.790  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true            all_properties             50000  avgt    5    712.971 ±  51.322  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true  required_properties_only              5000  avgt    5     66.466 ±   1.964  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true  required_properties_only             50000  avgt    5    710.670 ±  30.888  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true                      none              5000  avgt    5    561.498 ±  19.765  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                            true                      none             50000  avgt    5   5580.690 ± 349.167  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false            all_properties              5000  avgt    5     66.549 ±   6.975  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false            all_properties             50000  avgt    5    699.403 ±  19.309  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false  required_properties_only              5000  avgt    5     66.758 ±   2.700  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false  required_properties_only             50000  avgt    5    735.704 ±  23.594  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false                      none              5000  avgt    5    554.366 ±  37.383  ms/op
CQLMultiQueryPropertiesBenchmark.getProperties                                           false                      none             50000  avgt    5   5747.380 ± 317.308  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true            all_properties              5000  avgt    5     33.777 ±   2.917  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true            all_properties             50000  avgt    5    362.098 ±  21.880  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true  required_properties_only              5000  avgt    5     34.825 ±   2.701  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true  required_properties_only             50000  avgt    5    358.799 ±  20.121  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true                      none              5000  avgt    5    558.541 ±  67.242  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                              true                      none             50000  avgt    5   5637.202 ± 365.268  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false            all_properties              5000  avgt    5     34.979 ±   2.872  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false            all_properties             50000  avgt    5    363.162 ±  23.248  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false  required_properties_only              5000  avgt    5     35.036 ±   1.207  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false  required_properties_only             50000  avgt    5    351.963 ±  13.566  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false                      none              5000  avgt    5    439.641 ±  18.095  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertiesSingleProperty                             false                      none             50000  avgt    5   4448.214 ± 166.877  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true            all_properties              5000  avgt    5     69.432 ±   3.807  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true            all_properties             50000  avgt    5    736.930 ±  31.238  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true  required_properties_only              5000  avgt    5     69.007 ±   2.666  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true  required_properties_only             50000  avgt    5    744.226 ±  18.976  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true                      none              5000  avgt    5    571.507 ±  53.258  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                           true                      none             50000  avgt    5   5785.100 ± 191.183  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false            all_properties              5000  avgt    5     69.287 ±   8.058  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false            all_properties             50000  avgt    5    743.985 ±  26.331  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false  required_properties_only              5000  avgt    5     69.059 ±   2.332  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false  required_properties_only             50000  avgt    5    747.027 ±  34.966  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false                      none              5000  avgt    5    551.549 ±  39.044  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMap                                          false                      none             50000  avgt    5   5726.657 ± 581.692  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true            all_properties              5000  avgt    5     35.063 ±   2.488  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true            all_properties             50000  avgt    5    363.953 ±  24.081  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true  required_properties_only              5000  avgt    5     34.937 ±   1.652  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true  required_properties_only             50000  avgt    5    364.189 ±  20.129  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true                      none              5000  avgt    5    544.661 ±  20.162  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                             true                      none             50000  avgt    5   5752.292 ± 157.064  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false            all_properties              5000  avgt    5     35.205 ±   1.568  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false            all_properties             50000  avgt    5    364.262 ±  14.127  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false  required_properties_only              5000  avgt    5     35.030 ±   1.196  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false  required_properties_only             50000  avgt    5    371.353 ±  14.955  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false                      none              5000  avgt    5    445.629 ±  27.382  ms/op
CQLMultiQueryPropertiesBenchmark.getPropertyMapSingleProperty                            false                      none             50000  avgt    5   4494.510 ± 148.243  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true            all_properties              5000  avgt    5     67.419 ±   2.832  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true            all_properties             50000  avgt    5    728.799 ±  28.346  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true  required_properties_only              5000  avgt    5     68.160 ±   3.346  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true  required_properties_only             50000  avgt    5    724.124 ±  24.175  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true                      none              5000  avgt    5    555.419 ±  50.307  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                              true                      none             50000  avgt    5   5726.728 ± 564.049  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false            all_properties              5000  avgt    5     68.239 ±   3.272  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false            all_properties             50000  avgt    5    738.235 ±  31.935  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false  required_properties_only              5000  avgt    5     69.059 ±   2.449  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false  required_properties_only             50000  avgt    5    749.235 ±  33.987  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false                      none              5000  avgt    5    552.312 ±  58.427  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMap                                             false                      none             50000  avgt    5   5790.018 ± 462.477  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true            all_properties              5000  avgt    5     63.514 ±   1.546  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true            all_properties             50000  avgt    5    677.469 ±  23.601  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true  required_properties_only              5000  avgt    5    141.661 ±   6.852  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true  required_properties_only             50000  avgt    5   1444.020 ±  49.057  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true                      none              5000  avgt    5   2179.408 ± 115.846  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                            true                      none             50000  avgt    5  21695.837 ± 756.089  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false            all_properties              5000  avgt    5     64.549 ±   2.058  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false            all_properties             50000  avgt    5    683.062 ±  24.900  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false  required_properties_only              5000  avgt    5    137.145 ±   9.532  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false  required_properties_only             50000  avgt    5   1466.797 ±  74.115  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false                      none              5000  avgt    5   2161.010 ±  42.815  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapMultipleProperties                           false                      none             50000  avgt    5  21686.028 ± 611.169  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true            all_properties              5000  avgt    5     34.908 ±   1.227  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true            all_properties             50000  avgt    5    365.312 ±  15.131  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true  required_properties_only              5000  avgt    5     35.252 ±   1.351  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true  required_properties_only             50000  avgt    5    368.327 ±  13.142  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true                      none              5000  avgt    5    543.236 ±  10.970  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                                true                      none             50000  avgt    5   5589.739 ± 524.570  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false            all_properties              5000  avgt    5     34.666 ±   3.327  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false            all_properties             50000  avgt    5    362.896 ±  23.284  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false  required_properties_only              5000  avgt    5     35.176 ±   1.664  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false  required_properties_only             50000  avgt    5    370.041 ±  17.217  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false                      none              5000  avgt    5    446.955 ±  24.421  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapSingleProperty                               false                      none             50000  avgt    5   4511.168 ± 204.798  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true            all_properties              5000  avgt    5     92.109 ±   4.862  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true            all_properties             50000  avgt    5   1014.247 ±  33.165  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true  required_properties_only              5000  avgt    5     92.439 ±   3.355  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true  required_properties_only             50000  avgt    5   1009.004 ±  41.407  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true                      none              5000  avgt    5    971.429 ± 105.909  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                   true                      none             50000  avgt    5   9752.056 ± 721.270  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false            all_properties              5000  avgt    5     91.382 ±   2.903  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false            all_properties             50000  avgt    5    992.201 ±  44.254  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false  required_properties_only              5000  avgt    5     93.304 ±   3.209  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false  required_properties_only             50000  avgt    5    994.131 ±  40.706  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false                      none              5000  avgt    5    990.235 ± 140.411  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptions                                  false                      none             50000  avgt    5   9758.056 ± 207.459  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true            all_properties              5000  avgt    5     46.016 ±   1.733  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true            all_properties             50000  avgt    5     48.377 ±   2.322  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true  required_properties_only              5000  avgt    5     47.479 ±   1.976  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true  required_properties_only             50000  avgt    5     49.754 ±   1.992  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true                      none              5000  avgt    5    491.309 ±  40.796  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne            true                      none             50000  avgt    5    485.191 ±  37.842  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false            all_properties              5000  avgt    5     47.198 ±   2.897  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false            all_properties             50000  avgt    5     48.732 ±   2.481  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false  required_properties_only              5000  avgt    5     48.601 ±   1.201  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false  required_properties_only             50000  avgt    5     49.003 ±   1.574  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false                      none              5000  avgt    5    476.362 ±  13.168  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedBatchSizePlusOne           false                      none             50000  avgt    5    499.628 ±  37.291  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true            all_properties              5000  avgt    5      0.422 ±   0.101  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true            all_properties             50000  avgt    5      0.409 ±   0.086  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true  required_properties_only              5000  avgt    5      0.409 ±   0.080  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true  required_properties_only             50000  avgt    5      0.424 ±   0.077  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true                      none              5000  avgt    5      0.374 ±   0.103  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                         true                      none             50000  avgt    5      0.383 ±   0.063  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false            all_properties              5000  avgt    5      0.416 ±   0.127  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false            all_properties             50000  avgt    5      0.418 ±   0.092  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false  required_properties_only              5000  avgt    5      0.420 ±   0.066  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false  required_properties_only             50000  avgt    5      0.417 ±   0.070  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false                      none              5000  avgt    5      0.381 ±   0.059  ms/op
CQLMultiQueryPropertiesBenchmark.getValueMapWithOptionsLimitedOne                        false                      none             50000  avgt    5      0.374 ±   0.097  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true            all_properties              5000  avgt    5     65.434 ±   2.889  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true            all_properties             50000  avgt    5    714.199 ±  22.269  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true  required_properties_only              5000  avgt    5     66.761 ±   2.666  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true  required_properties_only             50000  avgt    5    708.990 ±  14.935  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true                      none              5000  avgt    5    560.789 ±  36.062  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                                true                      none             50000  avgt    5   5643.437 ± 623.577  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false            all_properties              5000  avgt    5     65.666 ±   2.099  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false            all_properties             50000  avgt    5    716.434 ±  55.903  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false  required_properties_only              5000  avgt    5     66.880 ±   1.951  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false  required_properties_only             50000  avgt    5    725.997 ±  12.796  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false                      none              5000  avgt    5    560.365 ±  65.514  ms/op
CQLMultiQueryPropertiesBenchmark.getValues                                               false                      none             50000  avgt    5   5711.132 ± 648.037  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true            all_properties              5000  avgt    5     63.484 ±   2.952  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true            all_properties             50000  avgt    5    746.533 ±  19.834  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true  required_properties_only              5000  avgt    5    139.326 ±   8.344  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true  required_properties_only             50000  avgt    5   1458.936 ± 103.243  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true                      none              5000  avgt    5   2224.397 ± 195.180  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                              true                      none             50000  avgt    5  21773.741 ± 579.365  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false            all_properties              5000  avgt    5     64.487 ±   3.771  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false            all_properties             50000  avgt    5    693.443 ±  18.040  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false  required_properties_only              5000  avgt    5    139.311 ±   7.451  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false  required_properties_only             50000  avgt    5   1434.126 ±  70.933  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false                      none              5000  avgt    5   2156.169 ±  90.986  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesMultipleProperties                             false                      none             50000  avgt    5  21794.364 ± 538.636  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true            all_properties              5000  avgt    5     33.929 ±   1.558  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true            all_properties             50000  avgt    5    359.879 ±  22.748  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true  required_properties_only              5000  avgt    5     35.042 ±   1.403  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true  required_properties_only             50000  avgt    5    365.083 ±  17.099  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true                      none              5000  avgt    5    545.211 ±  15.078  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                  true                      none             50000  avgt    5   5674.347 ± 249.404  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false            all_properties              5000  avgt    5     34.237 ±   1.167  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false            all_properties             50000  avgt    5    360.703 ±  24.964  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false  required_properties_only              5000  avgt    5     34.791 ±   1.498  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false  required_properties_only             50000  avgt    5    359.215 ±  20.418  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false                      none              5000  avgt    5    452.536 ±  24.715  ms/op
CQLMultiQueryPropertiesBenchmark.getValuesSingleProperty                                 false                      none             50000  avgt    5   4577.353 ± 184.405  ms/op

@porunov
Copy link
Member Author

porunov commented Jun 14, 2023

@FlorianHockmann @li-boxuan please, let me know if you have plans on reviewing this PR or would you be OK with lazy consensus for this PR.
I would prefer merging this PR before finishing with #3825 because in #3825 I will need to change many tests which are using profiling, due to how profiling works for multi-slice queries in #3825 . This will touch tests which are added in this PR as well as many other tests. Thus, to have less conflicts in this PR, I prefer merging it before finishing #3825 .

Copy link
Member

@li-boxuan li-boxuan left a comment

Choose a reason for hiding this comment

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

This is (another) great piece of work! I only have some nitpicks, mostly related to the doc.

One thing I am curious about: why did you put two significant efforts:

Adds possibility to fetch properties and labels of vertices using valueMap, elementMap, propertyMap steps.

and

Adds fetching modes to properties, values, valueMap, elementMap, propertyMap steps to be able to preFetch all properties (single slice query) or only required properties (separate slice query per each requested property).

to the same PR? Is that just a coincidence?

docs/configs/janusgraph-cfg.md Outdated Show resolved Hide resolved
docs/configs/janusgraph-cfg.md Outdated Show resolved Hide resolved
docs/operations/batch-processing.md Outdated Show resolved Hide resolved
docs/operations/batch-processing.md Outdated Show resolved Hide resolved
@porunov
Copy link
Member Author

porunov commented Jun 15, 2023

Thank you for the review!

This is (another) great piece of work! I only have some nitpicks, mostly related to the doc.

One thing I am curious about: why did you put two significant efforts:

Adds possibility to fetch properties and labels of vertices using valueMap, elementMap, propertyMap steps.

and

Adds fetching modes to properties, values, valueMap, elementMap, propertyMap steps to be able to preFetch all properties (single slice query) or only required properties (separate slice query per each requested property).

to the same PR? Is that just a coincidence?

Do you mean why didn't I split the work over the two separate PRs? If so, the new modes is kind of closely related to the optimizations I was doing, so I thought that it makes sense to do it together in the same PropertyMapStep / ElementMapStep optimization PR. Otherwise I would need to modify newly added JanusGraphPropertyMapStep and JanusGraphPropertyMapStep yet again in the new PR.

Just two be clear I will comment on both points:

Adds possibility to fetch properties and labels of vertices using valueMap, elementMap, propertyMap steps.

Currently in master branch the multi-query optimization exists for values and properties, but not for valueMap, elementMap, propertyMap. In this PR we are adding multi-query optimizations to the latter steps.

Adds fetching modes to properties, values, valueMap, elementMap, propertyMap steps to be able to preFetch all properties (single slice query) or only required properties (separate slice query per each requested property).

Currently in master branch values and properties steps can leverage existing multi-query optimization. That said, that optimization always fetches all requested properties separately (unless all properties fetching is requested explicitly. I.e. values()). Thus, if you try to execute something like .values("foo", "bar", "fooBar") the multi-query which currently is constructed in JanusGraphPropertiesStep will send 3 slice queries sequentially. Each new slice query will need to await until the previous slice query is fully finished. In many situations it might be quite inefficient.
Thus, in this PR I'm adding 3 modes. If users want the same behavior as was in master for values(...) step they simply need to chose required_properties_only mode. That said, if users prefer to fetch all properties via a single slice query then a new mode exists all_properties (this wasn't possible before this PR). I also added none mode which completely disables multi-query optimization for property steps. none mode isn't beneficial for users too much, but is mostly here for benchmark testing.

… [cql-tests] [tp-tests]

Adds possibility to fetch properties and labels of vertices using valueMap, elementMap, propertyMap steps.

Adds fetching modes to properties, values, valueMap, elementMap, propertyMap steps to be able to preFetch all properties (single slice query) or only required properties (separate slice query per each requested property).

Fixes JanusGraph#2444
Fixes JanusGraph#3814

Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
@porunov porunov force-pushed the feature/property-map-multi-query branch from c7423c6 to 813da90 Compare June 15, 2023 08:42
Copy link
Member

@FlorianHockmann FlorianHockmann left a comment

Choose a reason for hiding this comment

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

LGTM, I only found 3 really tiny linguistic / style nits in the docs. You can also just address those while merging.

docs/operations/batch-processing.md Show resolved Hide resolved
docs/configs/janusgraph-cfg.md Show resolved Hide resolved
docs/configs/janusgraph-cfg.md Show resolved Hide resolved
@porunov porunov merged commit e7b0eea into JanusGraph:master Jun 16, 2023
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.

Add documentation explaining how properties are fetched Enable multiQuery optimization for valueMap step
4 participants