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: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public From: dik@cwi.nl (Dik T. Winter) Subject: Re: What's the best language to start with? [was: Re: Should I learn C or Pascal?] Date: 1996/08/16 Message-ID: #1/1 X-Deja-AN: 174453839 sender: news@cwi.nl (The Daily Dross) references: <01bb88d4$022bf4a0$32ee6fce@timhome2> organization: CWI, Amsterdam newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada Date: 1996-08-16T00:00:00+00:00 List-Id: In article Dan.Pop@cern.ch (Dan Pop) writes: > >> >> > for (j = 0; j < 10; ++j) { > >> >> > for (i = 0; i < 50000; ++i) { > >> >> > ++a[i]; ++b[i]; ++c[i]; ++d[i]; ++e[i]; > >> >> > } > >> >> > } ... > Both versions have excellent paging locality. Read them again and tell > me which one is likely to produce more page faults than the other. Dan, obviously on a machine with only four pages the code above produces an enormous amount of page faults! Ah, a Commodore C64 with virtual memory. -- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924098 home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/