-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
🚀 v3 Request: New Parser for Binding #2002
Comments
I'd like to add another context about this impl. Key point here is not to use methods of with a function decorator, the decoder are pre-compiled and cached by nature. and this cached don't have overhead like map access. If the decoder is not pre-compiled, it's not that fast and low alloc: func Benchmark_lib_unmarshal(b *testing.B) {
decode := inj.CompileParser(Req{})
ctx := getCtx()
for i := 0; i < b.N; i++ {
_, err := decode(ctx)
if err != nil {
b.Error(err)
b.FailNow()
}
}
}
func Benchmark_lib_unmarshal_with_compile(b *testing.B) {
- decode := inj.CompileParser(Req{})
ctx := getCtx()
for i := 0; i < b.N; i++ {
+ decode := inj.CompileParser(Req{})
_, err := decode(ctx)
if err != nil {
b.Error(err)
b.FailNow()
}
}
}
|
if you have ideas or performance improvements, feel free to create a pull request with them and we'll see together how to get the best out of the respective functionalities. any comments or improvements are always welcome once the whole thing is released, it's hard to bend it, because non downward compatible changes require a new major version |
I'll send a PR later |
I want to know if the minimum go version that will be supported in the next release will be 1.18? |
I guess yes https://github.com/gofiber/fiber/blob/v3-beta/go.mod#L3 , and my pr need new generic support . |
Yes. v3 will support last 2 major versions of Go |
Feature Description
Currently, Fiber binding uses gorilla/schema and it's very slow and doesn't support multipart files (#1967).
We should write more performant, powerful parser acording to the needs of Fiber.
Check: #1981 (comment)
Additional Context (optional)
No response
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: