eduherminio / AoCHelper

Helper .NET library for solving Advent of Code puzzles

Home Page:https://adventofcode.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Enhancement] Timing for day construction

tslater2006 opened this issue · comments

I think it might be useful to (optionally?) allow to capture the timings of the day constructors. Day 7 of 2020, had a lot of up front processing that both parts leveraged. instead of doing it twice, it makes sense to put in the constructor. However doing so, the Part 1 and Part 2 become a lot slimmer just leveraging the data structures built by the constructor, and I think this results in artificially low runtimes, since the bulk of the processing wasn't accounted for.

That kind of makes sense @tslater2006.
Do you think we should get the time taken by the constructor added to both parts' time, or just having a separate, third measure common for both parts?
I have mixed feelings about it.

Yea, i've gone back and forth on it which is why I didn't suggest a particular way :) The way I see it there are 3 choices

  1. Separate line item for construction time
  2. Gets added to both parts (this is unfair and would artificially increase your "total runtime" for SolveAll)
  3. Get added to part 1 only, so part 1's runtime is Construction + Part1, and then Part 2 is on its own.

I think my preference is 1, 3, 2. I think 1 is easier in terms of making it optional? if people don't want that value to count then they can turn it off and just see what you see today. 3 is the only other "fair" way in terms of total runtime that I can think of.

Yea, i've gone back and forth on it which is why I didn't suggest a particular way :) The way I see it there are 3 choices

😆 fair enough.

I'll give it a thought, create one/some PoCs and get back to you in the following days.
It'll remain optional and probably also disabled by default, but we'll find a way to provide those stats.

Sounds good, thanks for being so open to feedback/enhancements :)

The feature was relatively easy to implement, but now I'm struggling to make spectre.console cope with so many re-rendering with my own 2020's repo (🥳 that means that it's kinda performant haha).
I'll have to either explore a new way of re-rendering the results table using that library or to move (back) to some less fancy results visualization, so it may take a some time.

Meanwhile, you can test the functionality itself (and your constructors!) with this package and:
Solver.SolveAll(new SolverConfiguration { ShowConstructorElapsedTime = true, ShowTotalElapsedTimePerDay = true });