[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interpreter performance

From: Bill Denney
Subject: Re: Interpreter performance
Date: Sun, 01 Oct 2006 10:07:50 -0400
User-agent: Thunderbird (Windows/20060909)

John W. Eaton wrote:
Looping, conditionals, and funtion calling is pretty much what the
interpreter does.  When you do core operations on large matrices, then
you are likely out of the realm of the interpreter.  You have one
funtion call that does a lot of work.  The function call is still
slow, but that is not as noticeable because your (large) operation is
taking a lot more time, and the interpreter is doing less.
To try to make this better, would you accept patches that try to avoid the looping, conditionals, etc.? I'm thinking about trying to go through the source tree and use cellfun instead of constructs like

if iscell (x)
 for i = 1:numel (x)
   retval(i) = function(x{i});

replace them with
if iscell (x)
 retval = cellfun ("function", x);

In some tests on some of the easy-to-modify string functions, this can give a ~2-3x speed up.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]