sightglass icon indicating copy to clipboard operation
sightglass copied to clipboard

Emit measurement results immediately

Open abrown opened this issue 3 years ago • 6 comments

@jameysharp mentioned in https://github.com/bytecodealliance/sightglass/issues/202#issuecomment-1269162316 that it would be nice if measurement results were emitted as soon as they were collected. Currently this is not the case: all the measurements for all of the benchmark runs are collected and emitted at the end. This issue could be fixable by refactoring how the measurements are serialized by serde.

abrown avatar Oct 06 '22 20:10 abrown

Another thing we could do, just to provide feedback that something is happening and the process isn't just hanging, is to print a dot to stderr after each iteration (maybe also a newline after every 80 dots too).

fitzgen avatar Oct 12 '22 13:10 fitzgen

To take this one step further, I've been going back and forth about whether we should bring in a progress meter here. We know how many iterations need to be run so it's not hard to keep track of the percentage complete. I even took a look at crates.io at some options but they all seem snazzier (and bigger) than what is needed here. cargo has a built-in, single-file progress meter that could be used too. So, it's possible, but on the "con" side, this is just one more thing to maintain, which might break, etc., so I'm on the fence. @fitzgen (and others: @cfallin, @jameysharp), what do you think?

abrown avatar Oct 13 '22 16:10 abrown

As someone who's spent a good amount of time staring at a sightglass invocation waiting for it to finish... some indication, even just "1% ... 2% ... 3% ... " textual output (adjust step size as desired), of how long I might be waiting would be very welcome! I've resorted to turning up RUST_LOG to see the individual invocations before to get some feedback.

cfallin avatar Oct 13 '22 16:10 cfallin

I would personally want to avoid any fancy progress bar, since it seems like it might introduce unnecessary noise into the system and seems a bit overkill.

fitzgen avatar Oct 13 '22 16:10 fitzgen

Ok, no progress bars. One thing I just looked up is whether we could detect an ANSI terminal and just rewrite the same line; seems like it might work with \r and there may be some crates that can do this kind of thing.

abrown avatar Oct 13 '22 16:10 abrown

Even simpler, just newlines? Perhaps with a --verbose flag we could emit a line after every run "Running compilation 1/N...", "Running instantiation 1/N...", "Running compilation 2/N...", etc?

cfallin avatar Oct 13 '22 16:10 cfallin