glidesort icon indicating copy to clipboard operation
glidesort copied to clipboard

Provide a way to easily reproduce benchmarks

Open marcospb19 opened this issue 2 years ago • 8 comments
trafficstars

Hey, glidesort is very impressive.

Could this provide an easy way to run benchmarks on our machines and see these results? (I'm willing to help if necessary).

(EDIT: by chance, I have a 4800 MHz dual-channel system available, and a 2666MHz single-channel one, I'm curious to compare bench results on both.)

marcospb19 avatar Feb 03 '23 21:02 marcospb19

I'd be happy to review a PR adding glidesort to https://github.com/LilithHafner/InterLanguageSortingComparisons. I'd also consider adding it myself if there are simple instructions/examples for using this algorithm with a stable version of rust.

LilithHafner avatar Feb 04 '23 16:02 LilithHafner

@LilithHafner

I'd also consider adding it myself if there are simple instructions/examples for using this algorithm with a stable version of rust.

Take a look at https://docs.rs/glidesort/latest/glidesort.

There's a unstable feature flag, but it's disabled by default, so you can use it with stable Rust already.

I hope this helps.

marcospb19 avatar Feb 04 '23 17:02 marcospb19

Thanks, those instructions were quite usable. I've made a PR to add glidesort to the benchmarks at InterLanguageSortingComparisons. Results indicate that glidesort underperforms rust's default sorting algorithm on that benchmark.

LilithHafner avatar Feb 06 '23 02:02 LilithHafner

@marcospb19 I do plan on releasing my benchmarks in a month or two in a separate repository, to also provide open an reproducible code for my upcoming paper. However right now the code is rather... 'academic' and needs cleaning up :)

orlp avatar Feb 06 '23 10:02 orlp

@LilithHafner As I mentioned there, you compared against [T]::sort_unstable, and on a platform where I don't claim glidesort outperforms that. It does outperform [T]::sort which is not included in your benchmark.

orlp avatar Feb 06 '23 10:02 orlp

@marcospb19 I do plan on releasing my benchmarks in a month or two in a separate repository

I'd love to see that. Why Another repository tho? I think it fits well on this crate repo.

You could add a [workspace] at the top of your Cargo.toml:

[workspace]
members = [
  ".",
  "glidesort-benchs",
]

Then you can run cargo new glidesort-benchs --bin, and it wouldn't affect the main crate.

Maybe you don't even need a workspace :thinking:, but it's a bit weird to have a project inside of another project, maybe there's some catch.

marcospb19 avatar Feb 06 '23 16:02 marcospb19

The purpose of InterLanguageSortingBenchmarks is to give a rough idea of performance across languages, not within them, so the primary comparison of note there is that Julia's default sorting algorithm (which happens to be stable) is about twice as fast as glidesort in that particular benchmark on that particular system.

LilithHafner avatar Feb 06 '23 18:02 LilithHafner

~~@LilithHafner I made some comments on the PR that adds glidesort regarding how you're doing measurements, and how that probably benefits Julia's algorithm~~.

EDIT: I was wrong, Julia really seems to be the fastest in that benchmark.

marcospb19 avatar Feb 06 '23 18:02 marcospb19