Skip to content

Optimize map key check in get_key - #10

Merged
oliveagle merged 1 commit into
oliveagle:masterfrom
superfell:get_key
Mar 10, 2018
Merged

Optimize map key check in get_key#10
oliveagle merged 1 commit into
oliveagle:masterfrom
superfell:get_key

Conversation

@superfell

Copy link
Copy Markdown
Contributor

I added a simple benchmark test, and added a optimized path in get_key that can verify the key exists without having to iterate all the keys (at least in a common case)

before
pkg: github.com/oliveagle/jsonpath
Benchmark_JsonPathLookup-8 100000 14529 ns/op

pkg: github.com/oliveagle/jsonpath
Benchmark_JsonPathLookup-8 100000 13516 ns/op

@oliveagle
oliveagle merged commit 1f2fa17 into oliveagle:master Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants