Skip to content

♻️ Refactor: Add findNextNonEscapedCharPosition for single-byte charset cases #3378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ksw2000
Copy link
Member

@ksw2000 ksw2000 commented Mar 29, 2025

Description

In path.go, there is a function findNextNonEscapedCharsetPosition that searches for the next character position from the charset and skips escaped characters. However, many cases only use a single byte in the charset. I added a new function findNextNonEscapedCharPosition and refactored these cases.

goos: linux
goarch: amd64
pkg: github.com/gofiber/fiber/v3
cpu: AMD EPYC 9J14 96-Core Processor
                                                                               │   old.txt   │              new.txt               │
                                                                               │   sec/op    │   sec/op     vs base               │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      160.4n ± 1%   159.0n ± 0%  -0.84% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        151.6n ± 0%   150.8n ± 0%  -0.53% (p=0.005 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       151.7n ± 0%   150.6n ± 0%  -0.73% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              162.3n ± 0%   160.8n ± 0%  -0.96% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           452.9n ± 1%   435.8n ± 0%  -3.79% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   455.6n ± 1%   435.7n ± 0%  -4.38% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  524.4n ± 1%   507.6n ± 1%  -3.19% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 528.2n ± 0%   508.7n ± 0%  -3.69% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                528.1n ± 0%   510.6n ± 0%  -3.31% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      500.3n ± 0%   489.0n ± 0%  -2.27% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     502.1n ± 0%   489.9n ± 0%  -2.44% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    515.5n ± 0%   498.8n ± 0%  -3.24% (p=0.000 n=20)
geomean                                                                          339.4n        331.1n       -2.46%

                                                                               │  old.txt   │               new.txt               │
                                                                               │    B/op    │    B/op     vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      144.0 ± 0%   144.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              152.0 ± 0%   152.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          288.8        288.8       +0.00%
¹ all samples are equal

                                                                               │  old.txt   │               new.txt               │
                                                                               │ allocs/op  │ allocs/op   vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          6.868        6.868       +0.00%
¹ all samples are equal

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Enhancement (improvement to existing features and functionality)
  • Documentation update (changes to documentation)
  • Performance improvement (non-breaking change which improves efficiency)
  • Code consistency (non-breaking change which improves code reliability and robustness)

Checklist

Before you submit your pull request, please make sure you meet these requirements:

  • Followed the inspiration of the Express.js framework for new functionalities, making them similar in usage.
  • Conducted a self-review of the code and provided comments for complex or critical parts.
  • Updated the documentation in the /docs/ directory for Fiber's documentation.
  • Added or updated unit tests to validate the effectiveness of the changes or new features.
  • Ensured that new and existing unit tests pass locally with the changes.
  • Verified that any new dependencies are essential and have been agreed upon by the maintainers/community.
  • Aimed for optimal performance with minimal allocations in the new code.
  • Provided benchmarks for the new code to analyze and improve upon.

…e-byte parameter

```
goos: linux
goarch: amd64
pkg: github.com/gofiber/fiber/v3
cpu: AMD EPYC 9J14 96-Core Processor
                                                                               │   old.txt   │              new.txt               │
                                                                               │   sec/op    │   sec/op     vs base               │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      160.4n ± 1%   159.0n ± 0%  -0.84% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        151.6n ± 0%   150.8n ± 0%  -0.53% (p=0.005 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       151.7n ± 0%   150.6n ± 0%  -0.73% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              162.3n ± 0%   160.8n ± 0%  -0.96% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           452.9n ± 1%   435.8n ± 0%  -3.79% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   455.6n ± 1%   435.7n ± 0%  -4.38% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  524.4n ± 1%   507.6n ± 1%  -3.19% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 528.2n ± 0%   508.7n ± 0%  -3.69% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                528.1n ± 0%   510.6n ± 0%  -3.31% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      500.3n ± 0%   489.0n ± 0%  -2.27% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     502.1n ± 0%   489.9n ± 0%  -2.44% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    515.5n ± 0%   498.8n ± 0%  -3.24% (p=0.000 n=20)
geomean                                                                          339.4n        331.1n       -2.46%

                                                                               │  old.txt   │               new.txt               │
                                                                               │    B/op    │    B/op     vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      144.0 ± 0%   144.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              152.0 ± 0%   152.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          288.8        288.8       +0.00%
¹ all samples are equal

                                                                               │  old.txt   │               new.txt               │
                                                                               │ allocs/op  │ allocs/op   vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          6.868        6.868       +0.00%
¹ all samples are equal
```
Copy link
Contributor

coderabbitai bot commented Mar 29, 2025

Walkthrough

This pull request refactors the parameter constraint handling in the path.go file. The changes remove multiple byte slice definitions and replace them with direct single byte references. Functions that detect non-escaped characters are updated to use a single byte argument, and the related function signature for splitting has been modified accordingly. Comments have also been updated for improved clarity, without altering the overall control flow or structure of the code.

Changes

File Change Summary
path.go - Removed byte slice declarations for parameter constraint characters and replaced them with single byte constants.
- Updated analyseParameterPart to call findNextNonEscapedCharPosition (single byte) instead of the previous function.
- Changed splitNonEscaped signature to accept a byte separator.
- Modified comments for clarity.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller
    participant Analyse as analyseParameterPart
    participant Next as findNextNonEscapedCharPosition
    participant Split as splitNonEscaped

    Caller->>Analyse: Call analyseParameterPart(input)
    Analyse->>Next: findNextNonEscapedCharPosition(input, constraintByte)
    Next-->>Analyse: Return position
    Analyse->>Split: splitNonEscaped(segment, separatorByte)
    Split-->>Analyse: Return segments
    Analyse-->>Caller: Return processed parameters
Loading

Possibly related PRs

Suggested labels

🧹 Updates, ⚡️ Performance

Suggested reviewers

  • sixcolors
  • efectn
  • gaby
  • ReneWerner87

Poem

I’m a little rabbit with hops so light,
Skipping through code in the crisp daylight.
Byte by byte, I dance and play,
Simplifying paths in a cheerful way.
With each change, my joy takes flight 🐇💫!
Celebrate clean code under the moonlit night.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between e90fe8a and 53f0e42.

📒 Files selected for processing (1)
  • path.go (6 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.73%. Comparing base (e90fe8a) to head (53f0e42).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3378      +/-   ##
==========================================
+ Coverage   83.66%   83.73%   +0.07%     
==========================================
  Files         118      118              
  Lines       11716    11722       +6     
==========================================
+ Hits         9802     9816      +14     
+ Misses       1486     1480       -6     
+ Partials      428      426       -2     
Flag Coverage Δ
unittests 83.73% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ksw2000 ksw2000 marked this pull request as ready for review March 29, 2025 05:36
@ksw2000 ksw2000 requested a review from a team as a code owner March 29, 2025 05:36
@ksw2000 ksw2000 requested review from gaby, sixcolors, ReneWerner87 and efectn and removed request for a team March 29, 2025 05:36
@gaby gaby requested a review from Copilot March 29, 2025 06:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors route pattern matching in path.go to introduce a new function (findNextNonEscapedCharPosition) for single-byte charset cases, improving both performance and code consistency. Key changes include:

  • Replacing usages of findNextNonEscapedCharsetPosition with findNextNonEscapedCharPosition in parameter analysis and constraint functions.
  • Updating splitNonEscaped to accept a byte separator instead of a string.
  • Removing now-unused multi-byte parameter constraint helpers.

@ReneWerner87 ReneWerner87 merged commit c2e39b7 into gofiber:main Mar 31, 2025
30 of 37 checks passed
@github-project-automation github-project-automation bot moved this to Done in v3 Mar 31, 2025
efectn pushed a commit to ckoch786/fiber that referenced this pull request May 15, 2025
…et cases (gofiber#3378)

♻️ Refactor: add findNextNonEscapedCharsetPosition to process a single-byte parameter

```
goos: linux
goarch: amd64
pkg: github.com/gofiber/fiber/v3
cpu: AMD EPYC 9J14 96-Core Processor
                                                                               │   old.txt   │              new.txt               │
                                                                               │   sec/op    │   sec/op     vs base               │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      160.4n ± 1%   159.0n ± 0%  -0.84% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        151.6n ± 0%   150.8n ± 0%  -0.53% (p=0.005 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       151.7n ± 0%   150.6n ± 0%  -0.73% (p=0.000 n=20)
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              162.3n ± 0%   160.8n ± 0%  -0.96% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           452.9n ± 1%   435.8n ± 0%  -3.79% (p=0.000 n=20)
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   455.6n ± 1%   435.7n ± 0%  -4.38% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  524.4n ± 1%   507.6n ± 1%  -3.19% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 528.2n ± 0%   508.7n ± 0%  -3.69% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                528.1n ± 0%   510.6n ± 0%  -3.31% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      500.3n ± 0%   489.0n ± 0%  -2.27% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     502.1n ± 0%   489.9n ± 0%  -2.44% (p=0.000 n=20)
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    515.5n ± 0%   498.8n ± 0%  -3.24% (p=0.000 n=20)
geomean                                                                          339.4n        331.1n       -2.46%

                                                                               │  old.txt   │               new.txt               │
                                                                               │    B/op    │    B/op     vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      144.0 ± 0%   144.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       136.0 ± 0%   136.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              152.0 ± 0%   152.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   368.0 ± 0%   368.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                432.0 ± 0%   432.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    424.0 ± 0%   424.0 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          288.8        288.8       +0.00%
¹ all samples are equal

                                                                               │  old.txt   │               new.txt               │
                                                                               │ allocs/op  │ allocs/op   vs base                 │
_RoutePatternMatch//api/v1/const_|_match_|_/api/v1/const-16                      4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1-16                        4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/-16                       4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/const_|_not_match_|_/api/v1/something-16              4.000 ± 0%   4.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_match_|_/api/abc/fixedEnd-16           9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/:param/fixedEnd_|_not_match_|_/api/abc/def/fixedEnd-16   9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity-16                  9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/-16                 9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_match_|_/api/v1/entity/1-16                9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v-16                      9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v2-16                     9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
_RoutePatternMatch//api/v1/:param/*_|_not_match_|_/api/v1/-16                    9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=20) ¹
geomean                                                                          6.868        6.868       +0.00%
¹ all samples are equal
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants