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

fix: negative hex #249

Closed
wants to merge 2 commits into from
Closed

fix: negative hex #249

wants to merge 2 commits into from

Conversation

veezhang
Copy link
Contributor

@veezhang veezhang commented Dec 14, 2022

fix: negative hex

Improve performance of checkVidFormat, the time is reduced by 92.22%.

name              old time/op  new time/op  delta
checkVidFormat-8  1.17µs ± 0%  0.09µs ± 3%  -92.22%  (p=0.000 n=8+10)

Benchmark code:

func Benchmark_checkVidFormat(b *testing.B) {
	for i := 0; i < b.N; i++ {
		_ = checkVidFormat("-0xfedcba9876543210", true)
		_ = checkVidFormat("-076543210", true)
		_ = checkVidFormat("-9876543210", true)
		_ = checkVidFormat("hash(\"abcdefg\")", true)
	}
}

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

#247

Description:

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

improve performance of checkVidFormat
@veezhang veezhang mentioned this pull request Dec 15, 2022
3 tasks
@yixinglu
Copy link
Contributor

This PR has been contained in others, so be free to close it.

@yixinglu yixinglu closed this Dec 15, 2022
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