Matthias Michler <[EMAIL PROTECTED]> writes:

> The result really surprises me (using module time):
>  time >plot<  9.7 sec
>  time >setp< 9.9 sec    <- slower than plot!
>  time >.set<  5.0 sec
>
> So my question is: Is this the expected / desired behaviour?

I think it is not surprising. The setp function (and much of the pylab
interface in general) is designed for convenience in interactive use,
and thus it handles various useful cases such as a list of objects as
the first argument, and different ways to specify properties (e.g.
setp(object, prop='value') and setp(object, 'prop', 'value')).
Eventually it does the equivalent of

  (getattr(object, 'set_%s'%prop))(value)

which is obviously much slower than the direct

  object.set_prop(value)

So, if you are writing a program, you are better off using the OO
interface.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to