youzan / ZanRedisDB

Yet another distributed fault-tolerant key-value database Compatible with Redis written in Golang.
MIT License
390 stars 60 forks source link

use EqualFold to compare tow strings #17

Closed wusphinx closed 5 years ago

wusphinx commented 5 years ago

just use strings.EqualFold to compare tow strings without case sensitive. example is here

codecov-io commented 5 years ago

Codecov Report

Merging #17 into master will increase coverage by 0.06%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   44.28%   44.34%   +0.06%     
==========================================
  Files         149      149              
  Lines       22357    22324      -33     
==========================================
  Hits         9900     9900              
+ Misses      10803    10768      -35     
- Partials     1654     1656       +2
Impacted Files Coverage Δ
common/util.go 0% <0%> (ø) :arrow_up:
transport/rafthttp/stream.go 80.13% <0%> (-0.66%) :arrow_down:
node/ttl.go 35.15% <0%> (ø) :arrow_up:
transport/rafthttp/peer.go 77.09% <0%> (+1.52%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8edd7a0...670ee94. Read the comment docs.

absolute8511 commented 5 years ago

Can you give a benchmark result for IsMergeScanCommand?

wusphinx commented 5 years ago

Can you give a benchmark result for IsMergeScanCommand? Yeah, I got it as below:

goos: darwin
goarch: amd64
pkg: examples/bench
BenchmarkIsMergeScanCommandNew-4    100000000           17.2 ns/op
BenchmarkIsMergeScanCommandOld-4    1000000000           2.76 ns/op
PASS
ok      examples/bench  4.788s

Obviously, Your code is better than mine on performance, consider that performance is more important than “beauty”, I will close this PR.