Re: TclX loop slow in the default case
- From: Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx>
- Date: Wed, 27 Aug 2008 00:23:49 -0700 (PDT)
On Aug 26, 11:02 pm, Evil Son <ewilsonm...@xxxxxxxxx> wrote:
proc loop_explicit {lim} {
loop i 0 1 $lim {}
Afraid you swapped two arguments here:
loop var start end ?increment? command
so you're iterating from 0 to 1 with a $lim increment, explaining the
constant and extremely short time for loop_explicit:
7 9 0.02 loop_explicit
7 9 0.02 loop_explicit
7 10 0.03 loop_explicit
In general, an O(N) algorithm suddenly switching to O(1) in constant
space is suspect ;-) Another, slightly more interesting case would be
a one-page proof that P=NP...
-Alex
.
- Follow-Ups:
- Re: TclX loop slow in the default case
- From: Evil Son
- Re: TclX loop slow in the default case
- References:
- TclX loop slow in the default case
- From: Evil Son
- TclX loop slow in the default case
- Prev by Date: Re: question about reset counter/data
- Next by Date: Re: TclX loop slow in the default case
- Previous by thread: TclX loop slow in the default case
- Next by thread: Re: TclX loop slow in the default case
- Index(es):