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

utils: performance improvement for parseDateTime #1117

Closed
wants to merge 1 commit into from
Closed

utils: performance improvement for parseDateTime #1117

wants to merge 1 commit into from

Conversation

chanxuehong
Copy link
Contributor

@chanxuehong chanxuehong commented May 30, 2020

Description

I optimized the performance of parseDateTime in the PR #1098.

Now I find that parseDateTime can still be optimized. The implementation of this version is like parseBinaryDateTime, see

mysql/utils.go

Line 126 in 096feaa

func parseBinaryDateTime(num uint64, data []byte, loc *time.Location) (driver.Value, error) {

Before:
BenchmarkParseDateTime-8   	 5117752	       235 ns/op
Now:
BenchmarkParseDateTime-8   	16154996	        74.8 ns/op

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@chanxuehong
Copy link
Contributor Author

I just saw #1113, please ignore this PR

@chanxuehong chanxuehong reopened this May 30, 2020
@julienschmidt julienschmidt changed the title feat: performance improvement for parseDateTime performance improvement for parseDateTime May 31, 2020
@julienschmidt julienschmidt changed the title performance improvement for parseDateTime utils: performance improvement for parseDateTime May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants