Skip to content

test: refactor body cache tests#1359

Draft
mavonx wants to merge 4 commits into
floatpane:masterfrom
mavonx:fix/issue-887
Draft

test: refactor body cache tests#1359
mavonx wants to merge 4 commits into
floatpane:masterfrom
mavonx:fix/issue-887

Conversation

@mavonx
Copy link
Copy Markdown
Contributor

@mavonx mavonx commented May 24, 2026

What?

Refactors the test suite for email body cache.

Why?

The previous implementation only covered a few narrow scenarios and failed to test the system under most practical edge cases.

Closes #887

@mavonx mavonx requested a review from a team as a code owner May 24, 2026 21:19
@floatpanebot floatpanebot added area/config Configuration / settings chore Maintenance, refactor, cleanup size/L Diff: 201–800 lines labels May 24, 2026
@floatpanebot
Copy link
Copy Markdown
Member

floatpanebot commented May 24, 2026

Benchmark report — no significant change

Metrics worse: 0 · better: 0 (threshold: ±3%).

benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 7763 64-Core Processor                
                           │    old.txt    │               new.txt                │
                           │    sec/op     │    sec/op      vs base               │
ParseSearchQuery_Simple-4    3.009µ ± 122%   2.630µ ± 322%        ~ (p=0.513 n=6)
ParseSearchQuery_Complex-4   7.778µ ±  33%   5.598µ ±  23%  -28.03% (p=0.026 n=6)
TokenizeSearchQuery-4        4.559µ ±  29%   3.534µ ±  60%        ~ (p=0.699 n=6)
geomean                      4.743µ          3.733µ         -21.29%

                           │  old.txt   │              new.txt               │
                           │    B/op    │    B/op     vs base                │
ParseSearchQuery_Simple-4    26.00 ± 0%   26.00 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   762.0 ± 0%   762.0 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        176.0 ± 0%   176.0 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      151.6        151.6       +0.00%
¹ all samples are equal

                           │  old.txt   │              new.txt               │
                           │ allocs/op  │ allocs/op   vs base                │
ParseSearchQuery_Simple-4    2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      7.453        7.453       +0.00%
¹ all samples are equal

pkg: github.com/floatpane/matcha/tui
                    │   old.txt    │              new.txt               │
                    │    sec/op    │    sec/op     vs base              │
LogPanelView-4        170.7µ ± 16%   187.0µ ± 12%       ~ (p=0.093 n=6)
SearchOverlayView-4   187.2µ ±  9%   202.3µ ± 22%       ~ (p=0.310 n=6)
InboxConstruction-4   801.9µ ± 14%   854.5µ ±  8%  +6.56% (p=0.041 n=6)
geomean               294.8µ         318.6µ        +8.05%

                    │    old.txt    │                new.txt                │
                    │     B/op      │      B/op       vs base               │
LogPanelView-4        44.67Ki ± 51%   21.79Ki ± 105%        ~ (p=0.242 n=6)
SearchOverlayView-4   44.67Ki ± 26%   33.16Ki ±  69%        ~ (p=0.437 n=6)
InboxConstruction-4   874.0Ki ±  0%   873.9Ki ±   0%        ~ (p=0.734 n=6)
geomean               120.4Ki         85.79Ki         -28.73%

                    │   old.txt   │              new.txt              │
                    │  allocs/op  │  allocs/op   vs base              │
LogPanelView-4         714.0 ± 0%    712.5 ± 0%       ~ (p=0.242 n=6)
SearchOverlayView-4    925.0 ± 0%    923.0 ± 0%       ~ (p=0.567 n=6)
InboxConstruction-4   3.476k ± 0%   3.475k ± 0%       ~ (p=0.610 n=6)
geomean               1.319k        1.317k       -0.15%

auto-generated by benchmarks.yml

@floatpanebot floatpanebot added the area/build Build system / Makefile / packaging label May 25, 2026
@andrinoff
Copy link
Copy Markdown
Member

@mavonx, please, drop 26c1f9a and c41b451 (git rebase -i HEAD~3 and place d (drop) instead of pick on these commits) don't forget to pull the branch

@andrinoff andrinoff removed the area/build Build system / Makefile / packaging label May 25, 2026
@mavonx
Copy link
Copy Markdown
Contributor Author

mavonx commented May 25, 2026

@andrinoff

I’m going to do a small refactor and add a few more tests as well, so I’d prefer to hold the review for now.

I’ll mention you once it’s ready for review.

@andrinoff andrinoff marked this pull request as draft May 25, 2026 15:52
@andrinoff
Copy link
Copy Markdown
Member

converting to draft will hold off reviews

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Configuration / settings chore Maintenance, refactor, cleanup size/L Diff: 201–800 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Add unit tests for config/cache.go

3 participants