Home / Function/ Benchmark_RoutePatternMatch() — fiber Function Reference

Benchmark_RoutePatternMatch() — fiber Function Reference

Architecture documentation for the Benchmark_RoutePatternMatch() function in path_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  bd2f2a11_77fe_4985_82e0_b7d24319febe["Benchmark_RoutePatternMatch()"]
  3c817cfc_3291_59ba_a2f8_291f66a9b0a1["path_test.go"]
  bd2f2a11_77fe_4985_82e0_b7d24319febe -->|defined in| 3c817cfc_3291_59ba_a2f8_291f66a9b0a1
  style bd2f2a11_77fe_4985_82e0_b7d24319febe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

path_test.go lines 365–392

func Benchmark_RoutePatternMatch(t *testing.B) {
	benchCaseFn := func(testCollection routeCaseCollection) {
		for _, c := range testCollection.testCases {
			// skip all cases for partial checks
			if c.partialCheck {
				continue
			}
			var matchRes bool
			state := "match"
			if !c.match {
				state = "not match"
			}
			t.Run(testCollection.pattern+" | "+state+" | "+c.url, func(b *testing.B) {
				for b.Loop() {
					if match := RoutePatternMatch(c.url, testCollection.pattern); match {
						// Get testCases from the original path
						matchRes = true
					}
				}
				require.Equal(t, c.match, matchRes, "route: '%s', url: '%s'", testCollection.pattern, c.url)
			})
		}
	}

	for _, testCollection := range benchmarkCases {
		benchCaseFn(testCollection)
	}
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Benchmark_RoutePatternMatch() do?
Benchmark_RoutePatternMatch() is a function in the fiber codebase, defined in path_test.go.
Where is Benchmark_RoutePatternMatch() defined?
Benchmark_RoutePatternMatch() is defined in path_test.go at line 365.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free