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

performance improvement on certain operation #38

Closed
wants to merge 3 commits into from

Conversation

ldkingvivi
Copy link
Contributor

  1. include reduce insert cost to 40% #37 but remove unnecessary changes, add the benchmark on this as well.

before

BenchmarkNetworkEqualIPv4-16          	 5917344	       198 ns/op	      64 B/op	       6 allocs/op
BenchmarkNetworkEqualIPv6-16          	 4486786	       273 ns/op	      42 B/op	       6 allocs/op

after

BenchmarkNetworkEqualIPv4-16          	100000000	        10.6 ns/op	       0 B/op	       0 allocs/op
BenchmarkNetworkEqualIPv6-16          	100000000	        10.9 ns/op	       0 B/op	       0 allocs/op
  1. change newPathprefixTrie to not call newPrefixTree, save time on extra parseCIDR and NewNetwork

before

BenchmarkNewPathprefixTriev4-16                                    	 2731194	       440 ns/op	     288 B/op	      12 allocs/op
BenchmarkNewPathprefixTriev6-16                                    	 1610536	       743 ns/op	     456 B/op	      16 allocs/op

after

BenchmarkNewPathprefixTriev4-16                                    	13315774	        88.3 ns/op	      16 B/op	       4 allocs/op
BenchmarkNewPathprefixTriev6-16                                    	 7967464	       153 ns/op	      64 B/op	       4 allocs/op

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.281% when pulling 9adafe1 on ldkingvivi:master into 7ff5a0e on yl2chen:master.

@coveralls
Copy link

coveralls commented Oct 4, 2020

Coverage Status

Coverage decreased (-2.2%) to 89.074% when pulling 38ddb96 on ldkingvivi:master into 7ff5a0e on yl2chen:master.

@ldkingvivi ldkingvivi closed this Oct 6, 2020
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.

None yet

2 participants