From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Teaching sorts [was Re: What's the best language to start with?] Date: 1996/08/24 Message-ID: #1/1 X-Deja-AN: 176235069 references: <01bb8f1b$ce59c820$32ee6fce@timhome2> <4vfk6b$i6h@krusty.irvine.com> <1996Aug22.165831.1@eisner> <4vjik9$eao@cnn.Princeton.EDU> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada Date: 1996-08-24T00:00:00+00:00 List-Id: Tim said "This sort of behavior isn't that rare at all; I've seen it in quite a number of my benchmarks. An interesting one I found is that the time required to memcpy() 34 bytes is 5 times *less* than the time required to memcpy 30 bytes on my system. From a graph of time vs n, it appears that memcpy() switches algorithms at 32 bytes (I believe from a straightforward copy to something along the lines of Duff's device, since assymptotically it is very close to my routine using the latter method). " Still you may be simply be seeing cache effects, it is very hard to control for these.