close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 20 years ago

Closed 18 years ago

Last modified 18 years ago

#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 Víctor de Buen Remiro

Resolution: remind
Status: newclosed
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"

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)
{

Real j_ := j_+1;
Copy(j<t)

});

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

comment:2 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://www.tol-project.org
Note: See TracTickets for help on using tickets.