Path: csiph.com!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail From: Melzzzzz Newsgroups: comp.lang.forth Subject: Re: Ruby/Forth challenge for WJ Date: Fri, 15 Jan 2016 03:05:20 +0100 Organization: albasani.net Lines: 23 Message-ID: <20160115030520.37cfb202@maxa-pc> 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> <87mvs7u7gz.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net 9EaiD9P7IaCXlRysnTi5PcIgDTke+03ZIZRPYVetAHfUYxsBhk5MYWRQqTdmFeEMwBEjdjpvKACgg9ghHy0FwQ== NNTP-Posting-Date: Fri, 15 Jan 2016 02:05:20 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="iRTJUq++gdGZlGQe5UbFUsoI3rWgej6yb4nFkeDK8Q3R+BTXCTzzcgu1vGIcSJcdT+pLnia9h2pm10IVHnGttqs+eFl9PhSAh7PSyTrR3vSvYUeBGdI9wtuioEdL2L9e"; mail-complaints-to="abuse@albasani.net" X-Newsreader: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-unknown-linux-gnu) Cancel-Lock: sha1:9kRkiNOfDqwcFeE+oWEouVpX4bM= Xref: csiph.com comp.lang.forth:44886 On Thu, 14 Jan 2016 14:22:36 -0800 Paul Rubin wrote: > 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. > This is same problem I met when constantly updating same memory cell vs initializing whole array (in assembly). Seems that cache trashing happens when updating same memory cell constantly.