[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Efficiency of the colon operator in Mata
> I remind Ben, we have already discovered that Ben's computer is
> slow at running colon operators. Most computers are not, but a
> older modern of the Intel chip is ...
and Dave asked:
> What version of processor are we talking about?
Of course I did not report timing from the machine Bill was having in
mind (Intel Centrino 1300MHz). The timings I reported were from an Intel
Xenon 3.30GHz (Dell PowerEdge 2850). Furthermore, I obtained similar
timings using an Intel Pentium 4 3.00GHz (Dell Dimension 4600i). (The
timings from the Intel Centrino look quite different as expected.)
> In any case, whenever Ben can avoid colon operators, he is going to
> better performance. The rest of us, however, will not.
Is this really true? I should have phrased my question differently: Is
the colon operator designed so that (almost) no computer time is lost if
it is used in an expression in which it is not really needed? From my
own timings and the timings reported by others it seems that using the
colon operator significantly slows down computations.
Will this be better if we buy new computers? This is important to me
because if yes, I will not bother to implement special code that does
not use the colon operator unless it is indispensable.
> And you don't take
> much of a penalty by performing the -if ... else-. So, it seems to
> sense in your case.
Of course my "real" application is much more complicated than the
stylized example. It would be much easier for me to just use the colon
operator and not bother about speed.
* For searches and help try: