> By the way, AFAIK, graphical handles are global objects passed by
> reference. Clement, aren't they?
The handle's .data fields are not stored into the stack they can be used
to pass by reference (and the handle act as the reference).
> It is possible to hide some data in their .userdata field
>
> > .../...
> > However using a tlist rhs/lhs force a copy which is not needed, using
> > named arguments let the interpreter avoid some copies.
> Do you mean that calls such as
>
> myfun(a, parname2=val2, parname1=val1)
>
> saves time and memory w.r.t.
>
> myfun(a, val1, val2)
>
> ?
Of co
Tim,
Using global variables as well saves time.
Here attached is Clement's bench tests extended to global variables and
global lists.
Typical results on my PC are (in [s]) :
-->exec('C:\computation.sci', -1)
local LISTS:not assigned: 0.34 create recipient: 1.362 assign2
existing recipe
Hello Clément,
Le 25/02/2015 09:16, Clément David a écrit :
.../...
However using a tlist rhs/lhs force a copy which is not needed, using
named arguments let the interpreter avoid some copies.
Do you mean that calls such as
myfun(a, parname2=val2, parname1=val1)
saves time and memory w.r.t.
I'm specifically hoping to avoid just exchanging pieces of the top-level
object, because it's pretty abstract -- I need to count on it doing
something generally similar, but possibly entirely different in the
details.
I realized, however, that I'm storing some pretty big arrays (several
arrays of
Hello Tim,
Yes, the copies are there as Scilab does not allow to pass data by
reference but only by copy.
To avoid extra copy when using tlist, you have to avoid data resize
which is really costly. When writing :
local_tlist.some_field = stuff;
There is no performance penalty if 'some_field' an
I have an algorithm that I'm working on that involves having large data
sets, which I'm currently representing as tlists. Due to the
constraints of the algorithm, I'm doing many calls that are more or less
of the form:
my_tlist = some_function(my_tlist);
The intent is to get the same effect tha