Skip to content

nsmkhn/rtbench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rtbench CI

OpenRTB 2.6 bid request parsing benchmarks in Go — profiling encoding/json with pprof and comparing three JSON implementations.

Companion source for the blog post: Go JSON Performance in Adtech: Profiling OpenRTB Bid Request Parsing

Run

Benchmark suite:

go test -bench=. -benchmem -count=5 ./openrtb/

CPU profile (stdlib):

go run ./cmd/profile
go tool pprof -top cpu.prof

CPU profile (goccy/go-json):

go run ./cmd/profile -impl gojson
go tool pprof -top cpu.prof

Structure

rtbench/
├── openrtb/
│   ├── types.go              # OpenRTB 2.6 struct definitions
│   ├── parse.go              # Parse() — encoding/json wrapper
│   ├── parse_test.go         # correctness tests (table-driven)
│   └── parse_bench_test.go   # benchmark suite
├── cmd/
│   └── profile/
│       └── main.go           # pprof CPU profiler (200k iterations)
└── testdata/
    ├── valid_banner.json
    └── valid_video.json

About

Companion source for the "Go JSON Performance in AdTech: Profiling OpenRTB Bid Request Parsing" blog post

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages