benchpress icon indicating copy to clipboard operation
benchpress copied to clipboard

Add `benchmarkWith`

Open ocramz opened this issue 4 years ago • 2 comments

Add a function that returns the result along the Stats, and specialize benchmark in terms of this one.

Addresses #9

Edit : I believe this needs a bit of background; while developing a library for nearest neighbors search I needed a way to benchmark retrieval accuracy against throughput. Since these depend on a number of internal parameters, one needs to collect timings alongside numerical results, so this is how this patch was born.

I look forward to all feedback. Thanks!

ocramz avatar May 13 '21 14:05 ocramz

Sorry - I must have missed this when you originally opened it!

I feel like it is a bit odd that this would only return the first result, and makes me think it should be more general (i.e. return all results, or take a callback function that gets passed results).

To understand your use-case better, could you share your example code please?

WillSewell avatar May 08 '22 20:05 WillSewell

Hi :) You're right, keeping only the head of the results list doesn't look good. It should be the responsibility of the user code to do that, if at all.

ocramz avatar May 09 '22 01:05 ocramz