# pquerna/ffjson

faster JSON serialization for Go

Repository: https://github.com/pquerna/ffjson
Canonical: https://ross.abutalabs.com/products/ffjson
Language: Go
License: Apache-2.0
License Family: permissive
Last push: 2023-09-21T19:52:42+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4549, "days_push": 1077, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2993, forks 234 (observed 2026-08-28T04:07:35.952372+00:00)

## What it is
ffjson is a Go code generator that emits static MarshalJSON and UnmarshalJSON functions for your struct types, removing the runtime reflection overhead of encoding/json. The generated code is a drop-in replacement implementing the standard encoding/json interfaces, typically making serialization and deserialization 2 to 3 times faster with no changes to calling code.

## Use cases
- speed up JSON serialization in Go
- avoid reflection overhead when encoding Go structs to JSON
- generate MarshalJSON and UnmarshalJSON implementations for my structs
- find a faster drop-in replacement for encoding/json
- optimize high-throughput JSON parsing in a Go API
- reduce JSON encoding CPU cost in hot code paths

## When to choose
- JSON marshaling/unmarshaling shows up prominently in your Go application's CPU profile
- you want to keep full compatibility with the encoding/json interfaces and fall back to it automatically for unsupported types
- your struct definitions change rarely, or you can wire code generation into your build process

## When to avoid
- your structs change frequently and regenerating code on every change is impractical
- your JSON workloads are small enough that encoding/json performance is not a bottleneck
- you prefer runtime drop-in serializers that require no code generation step

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: serialization, json, cli, developer-tools
- domain: developer-tools, web-development, apis, performance
- platform: go, cli, cross-platform
- tags: code-generation, go-codegen, drop-in-replacement, reflection-free, marshaljson, unmarshaljson, json-serialization, encoding-json

## Member repositories
- pquerna/ffjson (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:35.952372+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:31:18.804315+00:00, confidence not recorded.
  - readme: https://github.com/pquerna/ffjson (fetched 2026-08-28T04:07:35.952372+00:00, sha 327afa6911c1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
