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

Try to call Less() fewer times when iterating #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

a180285
Copy link

@a180285 a180285 commented Dec 31, 2022

Base on issue #42

Cached stop index when iterating. And following is some benchmark compare result on my PC.

Benchmarck

  goos: windows
  pkg: github.com/google/btree
  cpu: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz

- without cache
+ after cache stopIndex

  goarch: amd64 go1.18
- BenchmarkAscendRangeG-4            14937             74071 ns/op
+ BenchmarkAscendRangeG-4            22119             55385 ns/op

- BenchmarkDescendRangeG-4           12909             92070 ns/op
+ BenchmarkDescendRangeG-4           15200             78136 ns/op

- BenchmarkAscendRange-4              9895            122200 ns/op
+ BenchmarkAscendRange-4             14628             81924 ns/op

  goarch: amd64 go1.17
- BenchmarkAscendRange-4             12496             94311 ns/op
+ BenchmarkAscendRange-4             17521             68965 ns/op

@google-cla
Copy link

google-cla bot commented Dec 31, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@a180285
Copy link
Author

a180285 commented Dec 31, 2022

@a180285
Copy link
Author

a180285 commented Jan 3, 2023

Hi @gconnell , could you help reviewing this merge request?

@a180285
Copy link
Author

a180285 commented Feb 2, 2023

@gconnell @gauntface can you help review this? thank you.

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.

1 participant