• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blevesearch / bleve / 24210552498
52%

Build:
DEFAULT BRANCH: master
Ran 09 Apr 2026 08:01PM UTC
Jobs 1
Files 428
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Apr 2026 08:00PM UTC coverage: 51.682% (+0.03%) from 51.651%
24210552498

push

github

web-flow
(perf) pool queryStringLex to reuse bufio.Reader across query parses (#2300)

## Summary
- Pool `queryStringLex` (including its `bufio.Reader` with 4096-byte
internal buffer) via `sync.Pool` to avoid allocating a new instance on
every `parseQuerySyntax` call
- Every query string parse, including sub-queries in
boolean/conjunction/disjunction, goes through this path, making it a
high-frequency allocation hotspot
- Eliminates repeated `bufio.NewReader` allocation by reusing pooled
instances via `bufio.Reader.Reset()`

## Changes
- **search/query/query_string_lex.go**: Add `sync.Pool` with
`getQueryStringLex()` and `putQueryStringLex()` helpers. Original
`newQueryStringLex()` unchanged for backward compatibility.
- **search/query/query_string_parser.go**: `parseQuerySyntax()` uses
pooled lexer instead of allocating new one.
- **search/query/query_string_parser_test.go**: Updated `BenchmarkLexer`
to exercise the pooled path.

## Benchmark
```
goos: darwin
goarch: arm64
cpu: Apple M1

name            old ns/op   new ns/op   delta
BenchmarkLexer  1,682       1,233       -26.7%

name            old B/op    new B/op    delta
BenchmarkLexer  5,344       1,104       -79.3%

name            old allocs  new allocs  delta
BenchmarkLexer  54          52          -3.7%
```

## Checklist
- [x] Code compiles correctly and linting passes locally
- [x] Tests added for new functionality, or regression tests for bug
fixes added as applicable

28 of 28 new or added lines in 2 files covered. (100.0%)

19431 of 37597 relevant lines covered (51.68%)

0.58 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24210552498.1 09 Apr 2026 08:01PM UTC 428
51.68
GitHub Action Run
Source Files on build 24210552498
  • Tree
  • List 428
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 0afa561c on github
  • Prev Build on master (#24210492068)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc