#19 better formating for timer_info data

open
nobody
None
5
2012-11-18
2003-12-08
No

It would be nicer to round the floating-point values
for the times to a few (say three) decimal places.
Additionally, I like to sort the rows according to the total
time. The following data is messed up because the
line lengths are too long.

(C1) timer(factor,rat,ratsimp)$
(C2) e : (x+5)^13$
(C3) for i : 1 thru 100 do e : ratsimp(factor(rat(e)))$
(C4) timer_info();
[ FUNCTION TIME//CALL
CALLS RUNTIME GCTIME ]
[
]
[ RATSIMP 5.0E-4 SEC
200 0.1 SEC 0.0 ]
[
]
(D4) [ RAT 1.666666666666667E-4 SEC 100
0.01666666666667 SEC 0.0 ]
[
]
[ FACTOR 0.0045 SEC
100 0.45 SEC 0.0 ]
[
]
[ TOTAL 0.00141666666667 SEC 400
0.56666666666667 SEC 0.0 ]

After loading my patch

(C5) load("l:/odelin/new-timer-info.lisp")$

(D5)
(C6) timer_info();
[ FUNCTION TIME/CALL
CALLS RUNTIME GCTIME ]
[
]
[ factor 4.50E-3 100
4.50E-1 0.00E+0 ]
[
]
(D6) [ ratsimp 5.00E-4 200
1.00E-1 0.00E+0 ]
[
]
[ rat 1.67E-4 100
1.67E-2 0.00E+0 ]
[
]

I left out "sec" from each time; maybe "sec" should
be placed in the column descriptions.

Barton

Discussion

  • Stavros Macrakis

    Logged In: YES
    user_id=588346

    I agree that there should be a way of producing nicely-
    formatted output from timer_info. But I'm not sure how you'd
    do that using standard Maxima display, because it doesn't
    have any way to specify formatting in detail.

    You can get a *little* bit of what you want by printing with a
    given fpprec (though that is buggy, too...), but using default
    Maxima display for formatted output just doesn't work.

    In particular, Maxima has no way to align numeric columns by
    decimal point, and to align text columns on the left. So you
    will inevitably get column alignment like:

    F 4.023
    JJ 25.23
    RAT 3.0
    INTEGRATE 8.11

    It has no way of specifying that some numbers should be
    displayed with N significant digits (possibly using scientific
    notation) while others should be displayed in a fixed format.

    So if you want nicer output, it will not be the *return value*
    of timer_info, but a formatted output.

    Even better if we could extend Display to handle some sort of
    formatting....

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks