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 QAA18825; Mon, 10 Jun 2002 16:19:32 +0200 (MET DST) 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 QAA18853 for ; Mon, 10 Jun 2002 16:19:31 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mel-rto2.wanadoo.fr (smtp-out-2.wanadoo.fr [193.252.19.254]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5AEJVb20936 for ; Mon, 10 Jun 2002 16:19:31 +0200 (MET DST) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto2.wanadoo.fr (6.5.007) id 3CFF7EF10025C560 for caml-list@inria.fr; Mon, 10 Jun 2002 16:19:30 +0200 Received: from fourquauu8eg3x (193.252.8.28) by mel-rta9.wanadoo.fr (6.5.007) id 3CFB286C004640A4 for caml-list@inria.fr; Mon, 10 Jun 2002 16:19:30 +0200 From: "Lionel Fourquaux" To: Subject: RE: [Caml-list] Timing Ocaml Date: Mon, 10 Jun 2002 16:19:31 +0200 MIME-Version: 1.0 Message-ID: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; boundary="----=_NextPart_000_0007_01C2109A.993AC9D0"; micalg=SHA1 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C2109A.993AC9D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml- > list@pauillac.inria.fr] On Behalf Of Remi VANICAT > Sent: Monday, June 10, 2002 2:50 PM > To: caml-list@inria.fr > Subject: Re: [Caml-list] Timing Ocaml > > Dmitry Bely writes: > > > Chris Hecker writes: > > > > >>* The GNU C compiler gcc is recommended, as the bytecode > > >> interpreter takes advantage of gcc-specific features to enhance > > >> performance. > > >>What is the nature of these optimizations? > > > > > > GCC lets you take the address of a label. You can see in > > > byterun/interp.c that it uses a jump table instead of a switch when > > > you're using GCC. > > > > > > At least, that's what it looks like. > > > > I would rather say that gcc allows to force register allocation for some > > specific variable, while MSVC always ignore "register" specifier. No, that's not the problem. MSVC is usually very good at register allocation. > > > > #if defined(__GNUC__) && !defined(DEBUG) > > [...] > > #ifdef __i386__ > > #define PC_REG asm("%esi") > > #define SP_REG asm("%edi") > > #define ACCU_REG > > #endif > > [...] > > #endif > > well, it seem that threaded code also depend of being compile with > gcc: > > #if defined(__GNUC__) && __GNUC__ >= 2 && !defined(DEBUG) && !defined > (SHRINKED_ > GNUC) > #define THREADED_CODE > #endif > > so both register assignation and threaded code can imply a lot of > speedup. If you look at the generated code, you can see that MSVC uses registers very efficiently, and that the difference comes only from the threaded code. Mainly, it is forced to do two nearly successive jumps, and I think that this causes some pipeline problem in modern processors. If you check that bytecode ops are valid before the execution, and if you use __assume(0) as the default case, you can gain about 10% in execution speed, but the two successive jumps are still there. I don't know what MSVC 7 does, but I'd be interested. -- Lionel Fourquaux ------=_NextPart_000_0007_01C2109A.993AC9D0 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIICkzCCAo8w ggH4oAMCAQICEEIpURHMJHSDRExVWoLZ5s0wDQYJKoZIhvcNAQEEBQAwRzEZMBcGA1UEAxMQTGlv bmVsIEZvdXJxdWF1eDEqMCgGCSqGSIb3DQEJARYbbGlvbmVsLmZvdXJxdWF1eEB3YW5h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AAAAEAAAAC8sBqU5aAdCrabsMAXm3S8B AAAAAIABADAfMB2BG2xpb25lbC5mb3VycXVhdXhAd2FuYWRvby5mcjBnBgkqhkiG9w0BCQ8xWjBY MAoGCCqGSIb3DQMHMAcGBSsOAwIaMA4GCCqGSIb3DQMCAgIAgDANBggqhkiG9w0DAgIBQDAHBgUr DgMCBzANBggqhkiG9w0DAgIBKDAKBggqhkiG9w0CBTBqBgkrBgEEAYI3EAQxXTBbMEcxGTAXBgNV BAMTEExpb25lbCBGb3VycXVhdXgxKjAoBgkqhkiG9w0BCQEWG2xpb25lbC5mb3VycXVhdXhAd2Fu YWRvby5mcgIQQilREcwkdINETFVagtnmzTBsBgsqhkiG9w0BCRACCzFdoFswRzEZMBcGA1UEAxMQ TGlvbmVsIEZvdXJxdWF1eDEqMCgGCSqGSIb3DQEJARYbbGlvbmVsLmZvdXJxdWF1eEB3YW5hZG9v LmZyAhBCKVERzCR0g0RMVVqC2ebNMA0GCSqGSIb3DQEBAQUABIGAgqshO41HQA3YHtvpauuJTgIK HSTXCjLOH+gWXd/iet8GYL4PMC/V8XpjRPxRiqofxqQjna1vI2hNfQPJx/PvAKBF8XcdEm5h28ID g+pBcbuYavMwo28/4r1aX7/9A1dC+gV22LyoOKmXC+RVsSBBrs391qosVIExdf6hmRPgS18AAAAA AAA= ------=_NextPart_000_0007_01C2109A.993AC9D0-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners