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

perf(logql): Micro-optimizations for IP filter #14072

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/logql/log/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@ func isHexDigit(r byte) bool {
// It returns the number of chars in the initial segment of `s`
// which consist only of chars from `accept`.
func bytesSpan(s, accept []byte) int {
m := make(map[byte]bool)
var charset [256]bool

for _, r := range accept {
m[r] = true
charset[r] = true
}

for i, r := range s {
if !m[r] {
if !charset[r] {
return i
}
}
Expand Down
Loading