-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Avoid allocating on each call to rows.Columns #444
Conversation
LGTM
I'm afraid that adding / removing column from another session may break the cache. |
Okay, wow. Today I learned that a wrong push closes a PR Oo |
You can reopen it after making another push to the branch (or just rebase and force-push) |
Or at least team members can reopen it then |
That worked :-) I also updated the benchmark in the PR for the Go 1.8 beta. |
Please merge master.
The information cache is removed because prepared statement can return different columns. |
Thanks for your first contribution to the project! 👍 |
Description
Calling rows.Columns() always allocates a new slice, even if it was already called once. Cache the slice on the first call and return the cached value on subsequent calls.
Checklist