ziglang / gotta-go-fast

Performance Tracking for Zig
MIT License
234 stars 15 forks source link

Fix single benchmark command example #12

Closed Sahnvour closed 4 years ago

Sahnvour commented 4 years ago

main.zig does it, and it's very much needed :)

andrewrk commented 4 years ago

why is that needed?

Sahnvour commented 4 years ago

Nevermind, I was persuaded I needed it at one point but apparently that was a mistake on my end.

Sahnvour commented 4 years ago

Encountered again why I thought cache off is needed :

$ zig run --main-pkg-path . --pkg-begin app benchmarks/rand/main.zig --pkg-end --release-fast -lc bench.zig -- C:\dev\install\zig
Unable to open C:\dev\Zig\gotta-go-fast\benchmarks\std-hash-map\main.zig
: file not found

$ zig run --main-pkg-path . --pkg-begin app benchmarks/rand/main.zig --pkg-end --release-fast -lc bench.zig --cache off -- C:\dev\install\zig
{"samples_taken":15,"wall_time":{"median":703211300,"mean":703258923,"min":703119600,"max":703518900},"utime":{"median":0,"mean":0,"min":0,"max":0},"stime":{"median":0,"mean":0,"min":0,"max":0},"maxrss":0}
andrewrk commented 4 years ago

not sure why --cache off is relevant here. Is there a newline in the file path?

Sahnvour commented 4 years ago

There's no new line, and until --cache off is used (as in the second command), it appears the build executable is not remade and then tries to compile an old file that doesn't exist anymore (just switched branches). Sorry, that wasn't very explicit.

It's probably a silly error but I just don't see it.

andrewrk commented 4 years ago

Hmmmm this potentially looks like package arguments not being properly added to the cache hash. That's a big deal, we have to fix it, we can't just suggest to turn the cache off!