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

(WIP) compare and chart implementations from crates.io #5

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

nkconnor
Copy link

I'm not sure the preferred way to start integrating this. What came to mind is creating a benchmarks directory with a small CLI utility for specifying options, e.g.

cargo run --impls contrie,flurry --mix read_heavy --seeds 5

Python is used for the charting, but it'd probably be valuable to have CSV as an option so the user can create their own charts. With the existing output, there's only a handful of ways to slice the pie, so we could also add some additional preset charts with ease.

Also note, this module requires nightly since I pulled in nkconnor/sharded. I'm not sure if that is desirable.

Looking forward to any feedback!

}

fn pin(&self) -> Self::Handle {
unsafe { std::mem::transmute(self.0.pin()) }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this will end up never releasing garbage. You'd have to explicitly repin it to release garbage, which there isn't really a good way to do in flurry today.

@jonhoo
Copy link
Owner

jonhoo commented Aug 26, 2020

This looks great, and is a good idea. I'd love to have @xacrimon's input on this too.

I don't think having the benchmarker be nightly-only is a problem.

@xacrimon
Copy link

Well this looks just fantastic! I like it.

@xacrimon
Copy link

One thing I think needs change though is the default hasher. In a performance critical and concurrent environment the default hash_map::RandomState isn't a good default. It's quite slow and has a habit of obscuring benchmarks. fxhash, fnv-1a, twox-hash and wyhash are good benchmarking hashers.

@nkconnor
Copy link
Author

@xacrimon one thing I can do is add a feature flag, or probably runtime flag to select a hasher, with some sensible default.

Also, (and maybe this is overkill) if we target a config instead then it becomes somewhat natural to parameterize hashing as part of the benchmark.

seeds = 5

[[trials]]
label = "dashmap<S=ahash>"
impl = "dashmap"
hasher = "ahash"

[[trials]]
label = "dashmap<S=fxhash>"
impl = "dashmap"
hasher = "fxhash"

@nkconnor
Copy link
Author

I haven't put more effort into this yet but starting to look at it again. It looks like xacrimon et. al have advanced their bench suite quite a bit since this PR: https://github.com/xacrimon/conc-map-bench

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.

3 participants