[darcs-users] darcs patch: Adaptively choose display units.

Eric Kow kowey at darcs.net
Wed Feb 24 10:24:34 UTC 2010


On Wed, Feb 24, 2010 at 00:27:27 +0100, Petr Rockai wrote:
> Wed Feb 24 00:15:55 CET 2010  Petr Rockai <me at mornfall.net>
>   * Adaptively choose display units.

Oh, sorry!  I got confused.  Read email, Eric; don't skim!
 
> PS: With the patch, the output looks like this:

> ==============  =================  =================
>                         darcs-2.3     darcs-2.3.99.2
> ==============  =================  =================
> (un)revert mod     99.8ms d=0.8ms     94.7ms d=1.6ms

Yeah!  It's good that we do this, but one thing we need to be careful
about is to show the same time unit across the row so that we don't
display confusing things like 700ms against 1s.  I mean, people are
smart enough to do the conversion, but when you're staring at these
columns of numbers, you really want to make things as easy as possible.

So there ought to be some way for the table code to override or dictate
the time unit being used.  Also, the way I did the side-by-side merging
of variant tables is kinda stupid.  We would probably have an easier
time at if we didn't build intermediate tables and just mashed the rows
together first (and then picked the smaller timeunit across the whole
row).

Other comments are that (a) it may not be necessary to display the
deviation units if we always use the same one and (b) it may be useful
to display the sample size (ugh, that's getting wide again).

> -  adjust = (*) (multiplier (mtUnit mt))
> +   secs :: Double -> Maybe Double
> +   secs x | x > 2 = Just $ (fromInteger (floor x `mod` 60)) + (x - fromInteger (floor x))
> +          | otherwise = Nothing
> +   mins x | x > 60 = Just (floor x `div` 60)
> +          | otherwise = Nothing

Criterion.Analyse has code for this too, by the way.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100224/34aeb450/attachment.pgp>


More information about the darcs-users mailing list