Re: TclX loop slow in the default case
- From: Evil Son <ewilsonmail@xxxxxxxxx>
- Date: Wed, 27 Aug 2008 06:15:52 -0700 (PDT)
On Aug 27, 7:41 pm, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
...
As you know of course, the near 3x speed gain for [for] is due to
bytecode compilation of its body, while TclX's [loop] command calls
Tcl_EvalObj at each turn.
This experiment IMO fuels the idea that preprocessing could help in
Tcl too from time to time: it would allow to define countless such
variants of Tcl's optimized control primitives without losing the
performance.
I couldn't agree more.
Notice that if you're bold enough to ignore fears of string collision,
you can define a variant of proc that does dangerous-yet-useful regexp
parsing. Here you can use [regexp] just to locate the [loop] word, and
then [info complete] to properly find the boundaries of the statement.
Then it's just a matter of substituting the equivalent [for]
incantation...
I'm going to be looking at this method as well as some of the 'macro'
techniques available on the wiki. Baby steps just now ... but this
language is addictive.
Cheers.
Evil Son.
.
- References:
- TclX loop slow in the default case
- From: Evil Son
- Re: TclX loop slow in the default case
- From: Alexandre Ferrieux
- Re: 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: spinbox bug?
- Previous by thread: Re: TclX loop slow in the default case
- Next by thread: Re: TclX loop slow in the default case
- Index(es):
Relevant Pages
|