Skip to content

Benchmark tests for checking the performance of validation/defaulting using go-openapi.

License

Notifications You must be signed in to change notification settings

nikhita/go-openapi-validate-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-openapi-validate-benchmark

Benchmark tests for checking the performance of validation/defaulting against json marshalling/unmarshalling (using k8s.io/apimachinery/pkg/util/json).

The schema used for this test is at testdata/schema.json.

JSON Marshaling and Unmarshaling:

BenchmarkOpenAPI-4   	   30000	     60140 ns/op	   12226 B/op	     284 allocs/op

Validation and Defaulting:

BenchmarkOpenAPI-4   	    3000	    402998 ns/op	  256750 B/op	    1631 allocs/op

Comparison between both:

benchmark              old ns/op     new ns/op     delta
BenchmarkOpenAPI-4     60140         402998        +570.10%

benchmark              old allocs    new allocs    delta
BenchmarkOpenAPI-4     284           1631          +474.30%

benchmark              old bytes     new bytes     delta
BenchmarkOpenAPI-4     12226         256750        +2000.03%

About

Benchmark tests for checking the performance of validation/defaulting using go-openapi.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages