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: Ruby/Forth challenge for WJ Date: Thu, 14 Jan 2016 14:22:36 -0800 Organization: A noiseless patient Spider Lines: 14 Message-ID: <87mvs7u7gz.fsf@nightsong.com> References: <35f4686c-f2c4-4ed8-9c46-2238645b9b97@googlegroups.com> <6e01edb6-e936-4418-bb77-e2ef9369a339@googlegroups.com> <87si22mj3x.fsf@jester.gateway.pace.com> <87oacqmilx.fsf@jester.gateway.pace.com> <2a5759c0-2109-4bd5-bc31-8a87aaebecc0@googlegroups.com> <87a8oaurrx.fsf@nightsong.com> <45f4d146-8690-42b2-90eb-78b24d103e93@googlegroups.com> <2016Jan14.115741@mips.complang.tuwien.ac.at> <1bbf42e1-9a64-45c3-9820-aabde317ceb3@googlegroups.com> <689e95b2-af8b-42c0-bce2-977d9472381b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="560a36ee31cc4bcf69e115b311f0cc5c"; logging-data="22039"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18e+T5AkV589YD0WDYwEQnV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:B3e4IzBKLcQiFTGQ8vxxMWSV8zU= sha1:pBXjKs1V9wRK3SolHildEdp3hg4= Xref: csiph.com comp.lang.forth:44880 mhx@iae.nl writes: > Running the original code (translated to C, but resulting in nearly > the same machine code as shown for the C++ original) gives 470ms! I > didn't know the difference in Intel CPU could be that large (using a > i7-4930 @3.4 GHz myself), or that this code could be vectorized. Your C program takes 416 ms on the i7-3770 that I timed the C++ program on. Output of the C++ program is 0.386345 0.140901 which makes me wonder if something is off about the timing routine. When I comment out the call to init_array, the output is "1e-06 0.442457". Another idea is that the initial 0.386 sec is used in allocating or paging the 256MB buffer. But I find that running the loop in your program twice doubles the cpu time, to 852 msec. I'll test more stuff.