#250 closed defect (remind)
The function "While" is aproximately 4 times slower than the function "For" or "Eval"
Reported by: | maalamo | Owned by: | danirus |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | SetAlgebra | Version: | head |
Severity: | major | Keywords: | |
Cc: |
Description
Real SecIni = Copy(Time);
Real j = 0;
Real t = 100000;
Real While(j<t,
{
Real j := j+1;
Copy(False)
});
WriteLn("Segundos Trascurridos While: "<< (Copy(Time)-SecIni));
Real SecIni2 = Copy(Time);
Set a = For(1, t, Real(Real n)
{
Copy(False)
});
WriteLn("Segundos Trascurridos For: "<< (Copy(Time)-SecIni2));
Set a := Copy(Empty);
Real SecIni3 = Copy(Time);
Set a := Copy(Range(1, t, 1));
WriteLn("Segundos Trascurridos C: "<< (Copy(Time)-SecIni3));
Real SecIni4 = Copy(Time);
Set EvalSet(a, Real(Real n)
{
Copy(False)
});
WriteLn("Segundos Trascurridos EvalSet: "<< (Copy(Time)-SecIni4));
Change History (2)
comment:1 Changed 18 years ago by
Resolution: | → remind |
---|---|
Status: | new → closed |
Summary: | The function "While" is aproximately 4 times slower than the function "For" or "Eval" → The function "While" is aproximately 4 times slower than the function "For" or "Eval" |
comment:2 Changed 18 years ago by
bug_file_loc: | → http://www.tol-project.org |
---|
While is not properly slower than For or EvalSet but require evaluate more TOL expressions.
If you try this
Real j_ = 0;
Set EvalSet(a, Real(Real n)
{
});
elapsed time in While and EvalSet are very close.
This is not a bug but certainly TOL is slow in both cases, so status change to REMIND