Optimize deletion timestamp lookup by replacing sorting logic with linear scan to improve performance. Add profiling support with cmd/benchmark/profile.sh, introduce network load testing in benchmarks, and update benchmark reports with additional latency metrics (P90, bottom 10%).
This commit is contained in:
@@ -15,3 +15,22 @@ func FastEqual[A constraints.Bytes, B constraints.Bytes](a A, b B) (same bool) {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func FastCompare[A constraints.Bytes, B constraints.Bytes](
|
||||
a A, b B,
|
||||
) (diff int) {
|
||||
if len(a) != len(b) {
|
||||
return
|
||||
}
|
||||
ab := []byte(a)
|
||||
bb := []byte(b)
|
||||
for i, v := range ab {
|
||||
if v != bb[i] {
|
||||
if v > bb[i] {
|
||||
return 1
|
||||
}
|
||||
return -1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user