-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add QueryerContext interface #23
Conversation
If we don't support QueryerContext, the db.Query() call will always do "prepare" statement
2 similar comments
Thanks for doing this @surki . Is there a way to integrate benchmark this? |
@gchaincl Do you want me to benchmark with / without this change? Here is what I see sqlhook master (without this changes):
With this change:
Weirdly WithHooks is faster now, need to check how it got faster |
Interesting! I'd check whether mysql or psql implement |
They do implement, verified it.
I am in middle of something, I will get to this next week for further check |
Wow, that's impressive! Thank you so much for doing it. |
SessionResetter interface was the difference (MySQL driver implements it, so it was doing extra work that SQLHook wasn't doing, so SQLHooks was faster ...). I have implemented that, and as well as added unit tests for interface implementation. Numbers now (overhead is negligible):
|
That makes much more sense, this is a great piece of work! |
@keegancsmith I'd love to have your input on this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
hmm, so looks like driver.SessionResetter is go 1.10+. That makes SQLHook require go 1.10+. Or we could conditional compile it only for go1.10+: surki@bcd1551 |
surki@bcd1551 looks like the right approach to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update with the build tag changes and merge
Okay, thanks, we probably should update the benchmark numbers in README |
Good point
…On Thu, Feb 28, 2019, 08:37 Suresh Kumar ***@***.***> wrote:
Okay, thanks, we probably should update the benchmark numbers in README
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#23 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABOoeY6H_MqsfyxOSWMXQaz_w9QQQtZVks5vR4dEgaJpZM4ZnpBb>
.
|
If we don't support QueryerContext, the db.Query() call will always do
"prepare" statement
Solves issue #22