From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA31167; Tue, 11 Dec 2001 22:09:41 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA31057 for ; Tue, 11 Dec 2001 22:09:40 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBBL9T121101; Tue, 11 Dec 2001 22:09:29 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA31176; Tue, 11 Dec 2001 22:09:28 +0100 (MET) Date: Tue, 11 Dec 2001 22:09:28 +0100 From: Xavier Leroy To: Willem Duminy Cc: "Caml-List (E-mail)" Subject: Re: [Caml-list] Pairs vs. Records Message-ID: <20011211220928.C30744@pauillac.inria.fr> References: <412AC3D29865BA4FB75DBE3DBA869B9D098223@mwmx3.mweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <412AC3D29865BA4FB75DBE3DBA869B9D098223@mwmx3.mweb.com>; from WDuminy@mweb.com on Tue, Dec 11, 2001 at 04:36:52PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I had a progarm that used pairs int*int as the basis of the primary data > structure. After changing it to use records {row:int;col:int} the > program runs slower. This is very surprising indeed, because the OCaml compilers generate *exactly the same code* for building/accessing tuples and for building/accessing records (with no mutable fields). (Actually, this isn't quite right: records of floats are optimized specially, but not tuples of floats.) So, I'd look elsewhere for the cause of the performance loss. Notice that with modern processors, even tiny changes in the code (such as deleting or adding unused functions) can result in noticeable (and highly unpredictable...) performance differences, because of code placement effects. - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr