Skip to content

jiazhen-lin/graphql-dataloader-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

graphql-dataloader-benchmark

Framework

Execute resolvers per request in parallel by 50 goroutines, here is benchmark result

go test -bench=. -benchmem -benchtime=30s
BenchmarkTestWithLoader-8      	     100	 523596938 ns/op	 1867980 B/op	   44451 allocs/op
BenchmarkTestWithoutLoader-8   	     100	 561794184 ns/op	 2422942 B/op	   53185 allocs/op
PASS
ok  	github.com/jiazhen-lin/graphql-dataloader-benchmark	123.330s

Use loader to reduce DB query count efficiently

BenchmarkTestWithLoader-8      	     Query count: 1010, Cost time: 32243951000 (nano), Ave time: 31924703.960396 (nano)
BenchmarkTestWithoutLoader-8   	     Query count: 50406, Cost time: 2498154653000 (nano), Ave time: 49560660.496766 (nano)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages