Skip to main content
Version: Next

⚡ Make Fiber Faster

Custom JSON Encoder/Decoder

Since Fiber v2.32.0, we have adopted encoding/json as the default JSON library for its stability and reliability. However, the standard library can be slower than some third-party alternatives. If you find the performance of encoding/json unsatisfactory, we suggest considering these libraries:

Example
package main

import "github.com/gofiber/fiber/v3"
import "github.com/goccy/go-json"

func main() {
app := fiber.New(fiber.Config{
JSONEncoder: json.Marshal,
JSONDecoder: json.Unmarshal,
})

# ...
}

References