Deutsch   English   Français   Italiano  
<mc77onF8d4vU1@mid.individual.net>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: nntp.eternal-september.org!news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: minforth <minforth@gmx.net>
Newsgroups: comp.lang.forth
Subject: Re: OOS approach revisited
Date: Fri, 27 Jun 2025 11:49:11 +0200
Lines: 19
Message-ID: <mc77onF8d4vU1@mid.individual.net>
References: <fdbeb48de8ceb748d44c67dc3981a566@www.novabbs.com>
 <84d259e0f1d6210d84c7840af5d51f4ebdd71ed4@i2pn2.org>
 <c9158c200102c2e508f8ef11deecdc27@www.novabbs.com>
 <248abae6393c59470a015b195642e266@www.novabbs.com>
 <0087b3b084f8af01cf9fb29bf50c389a104e1ffa@i2pn2.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 3DGACgg5d5g/GWhZ3bUBTQVGeVMFyEwAFrDX8A8Nzoke15HTqO
Cancel-Lock: sha1:D5E5FiPb8uU64M42fYLrFtEvP2E= sha256:K6wAUX+l4n5MRyjhI3ih3Qvk06q3UKN9r22NvtNmt1s=
User-Agent: Mozilla Thunderbird
In-Reply-To: <0087b3b084f8af01cf9fb29bf50c389a104e1ffa@i2pn2.org>

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.