Sujet : Re: OOS approach revisited
De : minforth (at) *nospam* gmx.net (minforth)
Groupes : comp.lang.forthDate : 27. Jun 2025, 10:49:11
Autres entêtes
Message-ID : <mc77onF8d4vU1@mid.individual.net>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
Am 27.06.2025 um 09:29 schrieb dxf:
On 27/06/2025 12:16 pm, minforth wrote:
...
IIRC DO..LOOPs had been a hack for computers in the 60s.
A rather ugly hack, born out of necessity, slow and
often cumbersome to use. That it still persists in Forth
half a century later speaks for Forth's progressiveness.
Testing FOR NEXT on my DTC system showed 15% speed increase over
DO LOOP. Putting 5 NOOPs (executes forth's address interpreter)
in the innermost loop brought it down to 6%. Not worth it IMO.
It really depends on how counted loops are implemented.
Most CPUs have operators for register-based count-down loops
that are blazingly fast.
If they can be used within Forth-based loop constructs
I would expect a greater speed increase than what you measured.