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

Improve query pool #1104

Merged
merged 6 commits into from
May 5, 2018
Merged

Improve query pool #1104

merged 6 commits into from
May 5, 2018

Conversation

nightlyone
Copy link
Contributor

So query creation is more efficient as well as as identical as possible in Session.Bind and Session.Query.

nightlyone added 5 commits May 5, 2018 11:18
so the lock hold time is shortened.
while modern Go compilers should combine all those stores to an more
efficient clearing, lets be explicit here and have a little simpler code.

This also makes it impossible to forget any newly added fields.
so we don't miss any settings, like missing Query.serialCons and
Query.defaultTimestamp in the Session.Bind method.
so in stays consistent in the future between Session.Bind and Session.Query.
@nightlyone
Copy link
Contributor Author

Hi all,
not sure about using queryPool also for Session.Bind, so I allowed maintainer edits for you.

q.cons = 0
q.pageSize = 0
q.routingKey = nil
q.routingKeyBuffer = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

looking at this, we could probably keep these buffers between pooling but would need to verify that they are not kept around anywhere after being used.

@Zariel Zariel merged commit fd28640 into apache:master May 5, 2018
@nightlyone nightlyone deleted the improve_query_pool branch May 8, 2018 09:42
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