Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!news.quux.org!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: mhx@iae.nl (mhx) Newsgroups: comp.lang.forth Subject: Re: May the numbers speak - supplement Date: Fri, 13 Jun 2025 08:43:44 +0000 Organization: novaBBS Message-ID: <7833daedd900cdce052246e4d5e5b6c9@www.novabbs.com> References: <20129e22c76a2b18b0a745e9499cbd9b@www.novabbs.com> <37a6f52a3ab1ec533fcf7ef30beb1022@www.novabbs.com> <7c15e1538a1604ad3c7a293ae6196da2530cd1a4@i2pn2.org> <87zfed2sbn.fsf@nightsong.com> <87f0b8fea5b562a56a25da80572f94c4@www.novabbs.com> <87o6us3d58.fsf@nightsong.com> <784c4c9e2f2586eb6d7df5210ecca689@www.novabbs.com> <87jz5g39i4.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="309314"; mail-complaints-to="usenet@i2pn2.org"; posting-account="J+nubxJRM7ncpF4l6KLO+OONWmFAYJHVJegfwQXJ8vc"; User-Agent: Rocksolid Light X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Posting-User: 4e0dc1fdad1ead10b39e7eb5db19bf73d73e3ab3 X-Rslight-Site: $2y$10$Y/.uZBESyKw4o1uYxAyLaeMxFjvAPaJFkDWst5jr/vehvW1Y.7mWm On Thu, 12 Jun 2025 22:01:07 +0000, Paul Rubin wrote: > mhx@iae.nl (mhx) writes: >> iSPICE> TEST TEST TEST TEST >> \ dtimescan : 2515 clock ticks elapsed, 45296 >> \ timestrscan : 419 clock ticks elapsed, 45296 >> \ HMS : 419 clock ticks elapsed, 45296 >> It makes no difference. Whatever is holding it down must >> be quite severe. > > Is dtimescan the one that uses double word arithmetic for 16 bit > processors? It's doing more stuff, I would think. Weird that it > catches up after a few tries. Cache warming? The TICKS? word apparently can't be trusted under Windows 11. This is better: #2000000 VALUE #iters CREATE num ," 12:34:56" : .SECS MS? #1000000 #iters 3 * */ ." / " . ." ns per iteration." ; : TEST2 ( -- ) CR CR ." \ dtimescan : " TIMER-RESET num C@+ #iters 0 ?DO 2DUP dtimescan 2DROP 2DUP dtimescan 2DROP 2DUP dtimescan 2DROP LOOP dtimescan UD. SECS CR ." \ timestrscan : " TIMER-RESET num C@+ #iters 0 ?DO 2DUP timestrscan 2DROP 2DUP timestrscan 2DROP 2DUP timestrscan 2DROP LOOP timestrscan UD. SECS CR ." \ HMS : " TIMER-RESET num C@+ #iters 0 ?DO 2DUP hms DROP 2DUP hms DROP 2DUP hms DROP LOOP hms . SECS CR ." \ HMS2 : " TIMER-RESET num C@+ #iters 0 ?DO 2DUP hms2 3DROP 2DUP hms2 3DROP 2DUP hms2 3DROP LOOP hms2 ROT . SWAP . . SECS ; CLS TEST2 TEST2 TEST2 TEST2 \ dtimescan : 45296 / 15 ns per iteration. \ timestrscan : 45296 / 13 ns per iteration. \ HMS : 45296 / 5 ns per iteration. \ HMS2 : 12 34 56 / 53 ns per iteration. \ dtimescan : 45296 / 15 ns per iteration. \ timestrscan : 45296 / 14 ns per iteration. \ HMS : 45296 / 5 ns per iteration. \ HMS2 : 12 34 56 / 53 ns per iteration. \ dtimescan : 45296 / 16 ns per iteration. \ timestrscan : 45296 / 14 ns per iteration. \ HMS : 45296 / 5 ns per iteration. \ HMS2 : 12 34 56 / 53 ns per iteration. \ dtimescan : 45296 / 15 ns per iteration. \ timestrscan : 45296 / 14 ns per iteration. \ HMS : 45296 / 5 ns per iteration. \ HMS2 : 12 34 56 / 53 ns per iteration. ok HMS is three times faster than dtimescan and timestrscan, while HMS2 is 3.5 times slower (as expected). In practice, I'd use some variant of hms2. -marcel