1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-30 19:22:11 +00:00
miniflux-v2/internal/reader/xml
Julien Voisin 3051acf369
perf(xml): eliminate bound checks in filterValidXMLChars
Optimizes the filterValidXMLChars function by changing the loop variable type from int to uint to eliminate bound checks during compilation, resulting in a ~4% performance improvement.

- Changes loop variable i from int to uint to remove compiler-generated bound checks
- Adjusts type conversions accordingly to maintain correctness

```
goos: linux
goarch: arm64
pkg: miniflux.app/v2/internal/reader/parser
        │   old.txt   │              new.txt               │
        │   sec/op    │   sec/op     vs base               │
Parse-8   40.91m ± 3%   39.30m ± 2%  -3.94% (p=0.000 n=50)
```
2025-09-08 15:33:55 -07:00
..
decoder.go perf(xml): eliminate bound checks in filterValidXMLChars 2025-09-08 15:33:55 -07:00
decoder_test.go fix(reader): fix a crash introduced by d59990f1 2025-06-11 19:04:46 -07:00