frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

perf: bulk calls to Otter

Open dunglas opened this issue 1 month ago โ€ข 0 comments

I tried using the bulk feature of Otter to improve performance when dealing with uncommon headers. According to the benchmark I introduced in #2052, this slightly improves performance but at the cost of more allocations. I'm not sure if it is worth it.

goarch: arm64
pkg: github.com/dunglas/frankenphp
cpu: Apple M1 Pro
                   โ”‚  bench.old  โ”‚             bench.new              โ”‚
                   โ”‚   sec/op    โ”‚   sec/op     vs base               โ”‚
UncommonHeaders-10   131.4ยต ยฑ 2%   127.0ยต ยฑ 2%  -3.39% (p=0.004 n=10)

                   โ”‚   bench.old   โ”‚           bench.new            โ”‚
                   โ”‚     B/op      โ”‚     B/op      vs base          โ”‚
UncommonHeaders-10   19.31Ki ยฑ 41%   19.40Ki ยฑ 2%  ~ (p=0.796 n=10)

                   โ”‚ bench.old  โ”‚             bench.new              โ”‚
                   โ”‚ allocs/op  โ”‚ allocs/op   vs base                โ”‚
UncommonHeaders-10   19.00 ยฑ 0%   22.00 ยฑ 0%  +15.79% (p=0.000 n=10)

dunglas avatar Dec 01 '25 14:12 dunglas