Ben Sinclair
Ben Sinclair
I wanted to add the `countBits` feature because I'm implementing [Golomb coding](https://en.wikipedia.org/wiki/Golomb_coding) which uses a unary encoded prefix. A simple, fast way of counting consecutive zero or one bits seemed...
> Using `readBits` to get one bit at a time would work, but with builtins like `@ctz` available it seemed a shame to not use them. Actually, `readBits` isn't really...
One other thing is that the idiom in the unit tests of setting the `bit_count` field to 0 instead of calling `alignToByte()` won't work any more, which is a silent...
The thing that makes me uncertain about this overall change is that if two benchmarks have different numbers of iterations then they're not comparable. I've been reading up on some...
An issue with providing a function pointer is it would have to have its writer output fixed statically, I don't see how you could decide to write to a file...
What's the benefit over calling a function with a `BenchmarkResults`? The output capabilities of that are unlimited and as flexible as anything can be because a `BenchmarkResults` contains all the...
Fair enough, some prototype code to play with might help to clarify how it would work.
The measurement code is at https://github.com/hendriknielaender/zBench/blob/1f0249e43a956af09980d7d22045ffa404164868/zbench.zig#L91. Looking at this again, the switch should ideally be excluded from what's measured, but there will always be the overhead of calling to and...
To be a bit more constructive, maybe do what you're wanting to benchmark in a loop in your benchmark function, and then you get an average time over many executions...
Yes, it doesn't seem to be to do with the zig Timer implementation, I wrote a little C program to call `clock_gettime(CLOCK_BOOTTIME, &ts1)` twice and got the same result as...