Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Forth dictionary implementation and performance Date: Sun, 31 Jan 2016 12:05:15 -0800 Organization: A noiseless patient Spider Lines: 28 Message-ID: <87y4b5plac.fsf@jester.gateway.pace.com> References: <2016Jan29.184253@mips.complang.tuwien.ac.at> <87fuxfrfk4.fsf@jester.gateway.pace.com> <2016Jan30.145924@mips.complang.tuwien.ac.at> <2016Jan30.183857@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="560a36ee31cc4bcf69e115b311f0cc5c"; logging-data="27167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18aIDI0cUwP/bgxV/hstk1C" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:08OnR1bFg2WqodewwryIVJQGwp8= sha1:4iczk/BYBR+0rPmnnkD8PH6MvJ8= Xref: csiph.com comp.lang.forth:45220 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: >>gcc-4.7.2 does something more efficient for the memcmp than the rep >>[cmpsb] that gcc 4.4.5 uses on the reference machine. Wow, I'm surprised gcc as recently as 4.4.5 used rep cmpsb since I think those rep instructions have been considered slow holdovers from the 8086 era for quite a long time. > Compiling it with gcc-4.9.2 produced: > 99904228 instructions:u # 0.87 insns per cycle Ok, the difference was mostly the compiler. I guess this test was memcmp intensive but it's still interesting to see such a big difference. > (apparently there is also a difference in the dynamically linked > libraries between these systems that results in the difference of > executed instructions). I tried compiling with --whole-program and got just a tiny speedup. I have to ask, historically, did Forth in the minicomputer era really use this linked list representation? With a 1000 word vocabulary and maybe 1 mhz memory cycle, that's a significant amount of time just doing those lookups in a sizeable user program (10k tokens at 0.3 msec each is 3 seconds right there). I guess the representation lets FORGET work where hashing didn't, but did it matter? I also remember something about using multiple lists, then called "threads".