⚑
Make Fiber Faster

Custom JSON Encoder/Decoder

Since Fiber v2.32.0, we use encoding/json as default json library due to stability and producibility. However, the standard library is a bit slow compared to 3rd party libraries. If you're not happy with the performance of encoding/json, we recommend you to use these libraries:
Example
1
package main
2
​
3
import "github.com/gofiber/fiber/v2"
4
import "github.com/goccy/go-json"
5
​
6
func main() {
7
app := fiber.New(fiber.Config{
8
JSONEncoder: json.Marshal,
9
JSONDecoder: json.Unmarshal,
10
})
11
​
12
# ...
13
}
Copied!

References