mambocab / rumble

A simple library for comparing functions' runtimes.
MIT License
3 stars 0 forks source link

`time_this` api and `partial`s #12

Open mambocab opened 9 years ago

mambocab commented 9 years ago

I like the apparent of the current time_this API, at least for single-argument functions. However, I think there's a better API trying to get out.

Timer will take a functools.partial as an argument, but that introduces a lot of timing noise, which is probably not acceptable for this application. Thinking on it.

mambocab commented 9 years ago

One way to deal with the timing noise would be to add a "estimated timing overhead" to the end of each report. All that would be required would be running a noop through the existing timer-running infrastructure.

mambocab commented 9 years ago

Though the existing timing infrastructure finds the minimum runtime. We'd want the... mean? maximum?

mambocab commented 9 years ago

Current thinking on this:

Some caveats:

mambocab commented 9 years ago

The reason the default implementation should be with partial is because it's a much simpler API, especially if there's any setup to be done that involves stuff outside the stdlib.

mambocab commented 9 years ago

With the simplification of the call_with api, I'm leaving this until later.