Skip to content

caddyhttp: performance improvement in Regex Match#4143

Merged
mholt merged 1 commit intocaddyserver:masterfrom
calvinxiao:escaped-analysis
May 2, 2021
Merged

caddyhttp: performance improvement in Regex Match#4143
mholt merged 1 commit intocaddyserver:masterfrom
calvinxiao:escaped-analysis

Conversation

@calvinxiao
Copy link
Contributor

Below is the report using benchstat and cmd:

go test -run=BenchmarkHeaderREMatcher -bench=BenchmarkHeaderREMatcher -benchmem -count=10

name                old time/op    new time/op    delta
HeaderREMatcher-16     869ns ± 1%     658ns ± 0%  -24.29%  (p=0.000 n=10+10)

name                old alloc/op   new alloc/op   delta
HeaderREMatcher-16      144B ± 0%      112B ± 0%  -22.22%  (p=0.000 n=10+10)

name                old allocs/op  new allocs/op  delta
HeaderREMatcher-16      7.00 ± 0%      5.00 ± 0%  -28.57%  (p=0.000 n=10+10)

Below is the report using `benchstat` and cmd:

`go test -run=BenchmarkHeaderREMatcher -bench=BenchmarkHeaderREMatcher -benchmem -count=10`

```
name                old time/op    new time/op    delta
HeaderREMatcher-16     869ns ± 1%     658ns ± 0%  -24.29%  (p=0.000 n=10+10)

name                old alloc/op   new alloc/op   delta
HeaderREMatcher-16      144B ± 0%      112B ± 0%  -22.22%  (p=0.000 n=10+10)

name                old allocs/op  new allocs/op  delta
HeaderREMatcher-16      7.00 ± 0%      5.00 ± 0%  -28.57%  (p=0.000 n=10+10)
```
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the benchmark!

@mholt mholt merged commit 53ececd into caddyserver:master May 2, 2021
@mholt mholt added this to the v2.4.0 milestone May 2, 2021
@mholt mholt added the optimization 📉 Performance or cost improvements label May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimization 📉 Performance or cost improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants