I noticed that in the sage library (for instance in matrix_rational_dense) 
the following use of "verbose" is around a lot:

       t = verbose('Computing echelon form of %s x %s matrix over QQ using 
p-adic nullspace algorithm.'%(
            self.nrows(), self.ncols()))

Observe that:

 - The routine "verbose" itself is written in python, so there is some 
overhead concerned in calling it, even if the verbose level is so low that 
nothing gets printed.

 - the string formatting is done before "verbose" is even called, so it 
always happens. 

I didn't devise a test to see what the penalty is, but it's quite 
conceivably measurable. Shouldn't we provide a convenient system to do the 
expensive processing only when the verbose message is actually required? 
Perhaps some cython inline function or macro to put the appropriate 
conditional around the call?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to