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

Optimize execution of datasource-backed ZQueries #501

Merged
merged 8 commits into from
Aug 14, 2024

Conversation

kyri-petrou
Copy link
Collaborator

This PR rewrites the method which is responsible for partitioning a collection of ZQuery. There are 2 notable changes in this PR:

  1. We avoid unnecessary lifting of ZIO to ZQuery when we map a Continue.Get
  2. We avoid unnecessary conversions between different iterable types by having the internal methods use Arrays only.

With the above, we see ~30% improvement in throughput across the FromRequestBenchmark suite

Note that in order to make things a bit safer, I also added the Mode type-alias and an assertion for a method that the Mode cannot be Parallel. In order to remove the runtime overhead of the assertion, I adopted a similar approach to ZIO where the assertion disappears in the published artifacts

@kyri-petrou kyri-petrou merged commit 0af29d5 into zio:series/2.x Aug 14, 2024
21 checks passed
@kyri-petrou kyri-petrou deleted the optimizations-and-cleanups branch August 14, 2024 12:01
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.

1 participant