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

common: improve shared_cache and simple_cache efficiency with hash table #6909

Merged
merged 2 commits into from Dec 18, 2015

Conversation

mslovy
Copy link
Contributor

@mslovy mslovy commented Dec 13, 2015

This PR is based on the discussion of #4441
use the trick, rehash(), to initialize the bucket size of the hashmap.

Signed-off-by: Ning Yao zay11022@gmail.com

…h bucket size

Based on the PR ceph#4441

Signed-off-by: Ning Yao <zay11022@gmail.com>
if (weak_refs.count(key))
  weak_refs[key]
it traverses the b-tree twice
replace it with weak_refs.find(key), which traverses b-tree once

Signed-off-by: Ning Yao <zay11022@gmail.com>
liewegas added a commit that referenced this pull request Dec 18, 2015
common: improve shared_cache and simple_cache efficiency with hash table

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit 471164d into ceph:master Dec 18, 2015
@ghost ghost changed the title common: improve shared_cache and simple_cache efficiency common: improve shared_cache and simple_cache efficiency with hash table Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants