Deutsch   English   Français   Italiano  
<84d259e0f1d6210d84c7840af5d51f4ebdd71ed4@i2pn2.org>

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!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: dxf <dxforth@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: OOS approach revisited
Date: Tue, 24 Jun 2025 23:28:13 +1000
Organization: i2pn2 (i2pn.org)
Message-ID: <84d259e0f1d6210d84c7840af5d51f4ebdd71ed4@i2pn2.org>
References: <fdbeb48de8ceb748d44c67dc3981a566@www.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 24 Jun 2025 13:28:17 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="1843675"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc";
User-Agent: Mozilla Thunderbird
In-Reply-To: <fdbeb48de8ceb748d44c67dc3981a566@www.novabbs.com>
Content-Language: en-GB
X-Spam-Checker-Version: SpamAssassin 4.0.0

On 23/06/2025 3:09 pm, LIT wrote:
> 1 VARIABLE X
> 2 VARIABLE Y
> 3 VARIABLE Z
> 
> : TEST1 1000 0 DO 10000 0 DO  X @ Y @ + Z !  LOOP LOOP ; ok
> : TEST2 1000 0 DO 10000 0 DO  X Y Z +>  LOOP LOOP ; ok
> TICKS TEST1 TICKS 2SWAP DMINUS D+ D. 121 ok
> TICKS TEST2 TICKS 2SWAP DMINUS D+ D. 71 ok
> 
> : TEST1 1000 0 DO 10000 0 DO  1 X +! 1 Y +! X @ Y @ + Z !  LOOP LOOP ;
> ok
> : TEST2 1000 0 DO 10000 0 DO  X ++ Y ++  X Y Z +>  LOOP LOOP ; ok
> TICKS TEST1 TICKS 2SWAP DMINUS D+ D. 217 ok
> TICKS TEST2 TICKS 2SWAP DMINUS D+ D. 132 ok
> 
> '+>' moves a sum of two variables into body of the third one.
> 
> The results are rather promising, from one can see.

The saving come from rolling  @ @ + ! into a single very specialized
function.  But what about the loading of X Y and retrieving of Z which
are unavoidable in practice?  Should that not be included in the test?