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

Being able to store benchmarking metrics #24

Closed
NangiDev opened this issue Dec 7, 2022 · 3 comments · Fixed by #30
Closed

Being able to store benchmarking metrics #24

NangiDev opened this issue Dec 7, 2022 · 3 comments · Fixed by #30

Comments

@NangiDev
Copy link

NangiDev commented Dec 7, 2022

I had this idea of trying to store benchmarks in a file when running them with a specific command.

example on command: cargo bm 02
My cargo .config

That would call on a rust binary that runs the benchmarking command with --release flag and stores it into a txt-file.

I started on the feature here
My attempt

But could not really finish it in a smart and reliable way.

The idea is that inside /src/benchmarks/table.txt should contain a line per day.
Containing Day, latest and best score for both parts.

Ex: 01 L1:85.40µs B185.40µs L2:74.10µs B2:74.10µs
first being the day (01). L1 being latest part 1 and B1 being best part 1 and so on.
My table so far

I'm pretty new at Rust so I think I sort of tangled myself into a weird mess.
My biggest problem is how to replace and update the correct line of the file.

What do you think? Anyone have a better and simpler way of doing this? Is it even valuable?

@NangiDev NangiDev changed the title Save benchmarking metrics Being able to store benchmarking metrics Dec 7, 2022
@fspoettel
Copy link
Owner

Hey! We were discussing this in #16 already so I think this is a valuable feature to add!

I implemented a proof of concept on my 2022 repo (see here for output). I reworked the benchmarking a bit to take more samples, see here for how this works and what it looks like.

I can't access your repo for some reason - once your links are accessible, it would be cool to compare implementations and see how we can bring this to the everyone. 💪

@NangiDev
Copy link
Author

NangiDev commented Dec 7, 2022

Awesome!
Looks much better and very much like something I would want.

The repo was of course private. I made it public so you should be able to see it now.

My Rust skills aren't that good, so I don't think my solution has that much to keep, but maybe it gives you some ideas.
The reason why I posted it was to make sure I'm not spending tons of time on something someone else can create faster. And turns out you even have had a separate discussion about it.

This template is really nice working with 👍 thanks!

PS: I saw this Youtuber fetching the example input somehow 🤔 so that should be possible

Edit: I did quick test on one way of fetching example input. Gist
It's not perfect because it highly depends on the text in puzzle description being typed in a particular way. It works for all (1-7) puzzles release so far this year (2022)

@fspoettel
Copy link
Owner

I extracted the idea for fetching example inputs to #26

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 a pull request may close this issue.

2 participants