| Deutsch English Français Italiano |
|
<42d8a3bd5a96b1cfc0d77f0f3035feb7@www.novabbs.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: minforth@gmx.net (minforth) Newsgroups: comp.lang.forth Subject: Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!] Date: Sun, 15 Sep 2024 06:17:18 +0000 Organization: novaBBS Message-ID: <42d8a3bd5a96b1cfc0d77f0f3035feb7@www.novabbs.com> References: <nnd$61e0ad9a$48ed61c2@b4d945e456041481> <vasqjd$icjm$1@dont-email.me> <66d26c4b$1@news.ausics.net> <vaubf7$tbke$1@dont-email.me> <nnd$04cff141$0193ba04@301336b8dd8ed69a> <vbfqnd$v4c4$1@dont-email.me> <nnd$26b4d59b$27bdb181@ce638e508b04426e> <87bk0vbvgk.fsf@nightsong.com> <66e0fa58$1@news.ausics.net> <66e11d64$1@news.ausics.net> <877cbh4b6z.fsf@nightsong.com> <66e2a497$1@news.ausics.net> <2024Sep14.143207@mips.complang.tuwien.ac.at> <e29088cacf765cd0da6519e333fa78f1@www.novabbs.com> <2024Sep14.170836@mips.complang.tuwien.ac.at> <06f3574dfa63a100a731c944d8e16473@www.novabbs.com> <cf8cc69fba97f593f6e92d666929f15b@www.novabbs.com> <90389fea385c08c72f39d4fdef04d076@www.novabbs.com> <87f9a09cd377f544c27a8cd24bef3a45@www.novabbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="2116397"; mail-complaints-to="usenet@i2pn2.org"; posting-account="0+ejqm+s29REto3A2x2P4fP+XaUXf51pZgtYBR0nEqI"; User-Agent: Rocksolid Light X-Rslight-Posting-User: d2a19558f194e2f1f8393b8d9be9ef51734a4da3 X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Site: $2y$10$uw193ZAs0uSKd2QOs6EpK.FmoVuuF1T3rIn7Qj6wSMs.NkyewBByK Bytes: 2549 Lines: 25 On Sat, 14 Sep 2024 19:19:25 +0000, Ahmed wrote: > You are right. > I find with gforth: > > : go 0 do -0.1e neg_big fdrop loop ; > > without locals: > utime 100000000 go utime d>f d>f f- 1e-8 f* f. 0.06762074 us ok for 1e8 > times: (67.62 ns) > > and with locals: > utime 100000000 go utime d>f d>f f- 1e-8 f* f. 0.09961387 us ok for > 1e8 times: (99.61 ns) > > I missused the timing in the previous post. > Thanks for the correction. So with gforth it's about 30 nanosecs runtime disadvantage. IOW if you run the code 3*10^7 times it adds up to 1 sec disadvantage. While the locals version was easy to code, pretty straightforward and probably bug-free out of the box, how long did it take to code and debug the stack juggling version? Say 10 minutes longer. Break-even point would be around 2*10^10 runs, and the dubious assumption that CPU time is as valuable as human time.