Skip to content

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.

2 participants