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

Don't include pure object fields in ZQuery collection #2015

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

kyri-petrou
Copy link
Collaborator

As discussed on Discord, I gave this a go. Seems to offer a fairly good performance increase whenever we have a mix of pure and effectful fields.

series/2.x:

[info] Benchmark                                           Mode  Cnt    Score   Error  Units
[info] NestedZQueryBenchmark.multifieldBatchedQuery1000   thrpt    5  551.735 ± 8.117  ops/s
[info] NestedZQueryBenchmark.multifieldBatchedQuery10000  thrpt    5   45.115 ± 1.188  ops/s

PR:

[info] Benchmark                                           Mode  Cnt    Score   Error  Units
[info] NestedZQueryBenchmark.multifieldBatchedQuery1000   thrpt    5  633.503 ± 8.756  ops/s
[info] NestedZQueryBenchmark.multifieldBatchedQuery10000  thrpt    5   54.862 ± 0.919  ops/s

I also did some rough testing for cases that we don't have any pure fields, and it seems that the performance was roughly identical to what we had previously

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

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

It looks good!

I have one concern though (which is more general, and could be address in other PRs): we are adding more and more "optimized" code using mutable collections and so on, and I think it makes the code harder to read. I think it would be good to move this kind of code to dedicated functions so that the main "flow" stays short and readable. What do you think?

@kyri-petrou
Copy link
Collaborator Author

It looks good!

I have one concern though (which is more general, and could be address in other PRs): we are adding more and more "optimized" code using mutable collections and so on, and I think it makes the code harder to read. I think it would be good to move this kind of code to dedicated functions so that the main "flow" stays short and readable. What do you think?

Yeah I agree. I'll do it in a followup PR in a bit 👍

@kyri-petrou kyri-petrou merged commit 8ef7fb3 into series/2.x Nov 22, 2023
10 checks passed
@kyri-petrou kyri-petrou deleted the improved-object-execution branch November 22, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants