Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safe json decoder added #352

Merged
merged 1 commit into from May 19, 2020
Merged

safe json decoder added #352

merged 1 commit into from May 19, 2020

Conversation

kpacha
Copy link
Member

@kpacha kpacha commented Apr 11, 2020

$ go test -bench . -benchmem -benchtime 10s
goos: darwin
goarch: amd64
pkg: github.com/devopsfaith/krakend/encoding
BenchmarkDecoder/json-collection/collection-8         	 7517224	      1605 ns/op	    1472 B/op	      17 allocs/op
BenchmarkDecoder/json-collection/map-8                	 7459869	      1606 ns/op	    1472 B/op	      17 allocs/op
BenchmarkDecoder/json-map/collection-8                	17147770	       710 ns/op	     992 B/op	       6 allocs/op
BenchmarkDecoder/json-map/map-8                       	16881831	       704 ns/op	     992 B/op	       6 allocs/op
BenchmarkDecoder/safe-json-collection/collection-8    	 8487573	      1407 ns/op	    1504 B/op	      19 allocs/op
BenchmarkDecoder/safe-json-collection/map-8           	 8509557	      1406 ns/op	    1504 B/op	      19 allocs/op
BenchmarkDecoder/safe-json-map/collection-8           	 8538740	      1407 ns/op	    1504 B/op	      19 allocs/op
BenchmarkDecoder/safe-json-map/map-8                  	 8451696	      1406 ns/op	    1504 B/op	      19 allocs/op
PASS
ok  	github.com/devopsfaith/krakend/encoding	106.298s

this json decoder accepts any kind of json input (in opposition of the regular one). the downside of such flexibility is a decrement in throughput and an increment in memory consumed and allocations

@kpacha kpacha added the enhancement Enhancement request on an existing feature label Apr 11, 2020
@kpacha kpacha added this to the 1.2.0 milestone Apr 11, 2020
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 96.064% when pulling 6277c59 on safe_json into 23bbc40 on master.

@kpacha kpacha merged commit 3c72ecf into master May 19, 2020
@kpacha kpacha deleted the safe_json branch May 19, 2020 12:56
@github-actions
Copy link

github-actions bot commented Apr 7, 2022

This pull request was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement request on an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants