Home / Function/ Benchmark_SanitizePath() — fiber Function Reference

Benchmark_SanitizePath() — fiber Function Reference

Architecture documentation for the Benchmark_SanitizePath() function in static_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  1d6578d2_0417_614e_949c_f0a5c9456457["Benchmark_SanitizePath()"]
  f26a2d79_1e01_f027_82eb_45c4308747e8["static_test.go"]
  1d6578d2_0417_614e_949c_f0a5c9456457 -->|defined in| f26a2d79_1e01_f027_82eb_45c4308747e8
  style 1d6578d2_0417_614e_949c_f0a5c9456457 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/static/static_test.go lines 1137–1152

func Benchmark_SanitizePath(b *testing.B) {
	bench := func(name string, filesystem fs.FS, path []byte) {
		b.Run(name, func(b *testing.B) {
			b.ReportAllocs()
			for b.Loop() {
				if _, err := sanitizePath(path, filesystem); err != nil {
					b.Fatal(err)
				}
			}
		})
	}

	bench("nilFS - urlencoded chars", nil, []byte("/foo%2Fbar/../baz%20qux/index.html"))
	bench("dirFS - urlencoded chars", os.DirFS("."), []byte("/foo%2Fbar/../baz%20qux/index.html"))
	bench("nilFS - slashes", nil, []byte("\\foo%2Fbar\\baz%20qux\\index.html"))
}

Domain

Subdomains

Frequently Asked Questions

What does Benchmark_SanitizePath() do?
Benchmark_SanitizePath() is a function in the fiber codebase, defined in middleware/static/static_test.go.
Where is Benchmark_SanitizePath() defined?
Benchmark_SanitizePath() is defined in middleware/static/static_test.go at line 1137.

Analyze Your Own Codebase

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

Try Supermodel Free