MCPcopy Index your code
hub / github.com/labstack/echo / BenchmarkRawFunc_Int64_single

Function BenchmarkRawFunc_Int64_single

binder_test.go:2941–2966  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2939}
2940
2941func BenchmarkRawFunc_Int64_single(b *testing.B) {
2942 c := createTestContext("/search?param=1&param=100", nil, nil)
2943
2944 rawFunc := func(input string, defaultValue int64) (int64, bool) {
2945 if input == "" {
2946 return defaultValue, true
2947 }
2948 n, err := strconv.Atoi(input)
2949 if err != nil {
2950 return 0, false
2951 }
2952 return int64(n), true
2953 }
2954
2955 b.ReportAllocs()
2956 b.ResetTimer()
2957 type Opts struct {
2958 Param int64
2959 }
2960 for i := 0; i < b.N; i++ {
2961 var dest Opts
2962 if n, ok := rawFunc(c.QueryParam("param"), 1); ok {
2963 dest.Param = n
2964 }
2965 }
2966}
2967
2968func BenchmarkDefaultBinder_BindInt64_10_fields(b *testing.B) {
2969 type Opts struct {

Callers

nothing calls this directly

Calls 2

createTestContextFunction · 0.85
QueryParamMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…