From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 6F5267ED7A for ; Sun, 26 Aug 2012 17:06:37 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.210.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.210.182 as permitted sender) identity=mailfrom; client-ip=209.85.210.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-iy0-f182.google.com) identity=helo; client-ip=209.85.210.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-iy0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuUBAHc6OlDRVdK2mGdsb2JhbABFqQmJAgGIVggiAQEBAQEICQ0HFCeCIAEBAQMBEgIsARsSCwEDAQsGBQQHAxchIQEBEQEFAQoSBhMIChCHWwEDBgYLnUoJA4wignOELQoZJwMKV4hxAQUMihljhxEDlAKBU4EUiXqDKT6CToE3 X-IronPort-AV: E=Sophos;i="4.80,315,1344204000"; d="scan'208";a="170849066" Received: from mail-iy0-f182.google.com ([209.85.210.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 26 Aug 2012 17:06:36 +0200 Received: by ialo14 with SMTP id o14so11123906ial.27 for ; Sun, 26 Aug 2012 08:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=TYEx0CzW30A8p4U5mdQfpCc8+wsi9UQbwdhz1d+Uwgg=; b=x+buaMca7vACip4RNRCvoW/siVftsAD2YPL0vG05ZTvV6i1hvxWOrxDdgwWR6TR+yR uz3I0xMd8sKsO9ujEuDku8kRu7Kuzpqcly25kzJihKXjJ7MtNhmzheG36s4gFSIqBoay yf7YjSIpIismabssAzNWqlCTRsgu7Qsh5gYFPJcrqlrHeMhYTeAdNz6EuNpo/d1KANse 1I568V/5uDMoJf0J8cvaRnzIOh32iU2qzEOv4MDiCOuCYJUxwsJGGQv59xZ/Oyh5qCOe 9EeSl3Y+7HUxxiq13xTPFNoqE8l3QFhuRvGClCjhh/H7QmNNLx1zF1wxct8IaQDxpQme Tdiw== Received: by 10.50.184.198 with SMTP id ew6mr7697555igc.27.1345993595394; Sun, 26 Aug 2012 08:06:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.32.39 with HTTP; Sun, 26 Aug 2012 08:05:55 -0700 (PDT) In-Reply-To: <503A30A7.3030707@gmail.com> References: <503A30A7.3030707@gmail.com> From: Gabriel Scherer Date: Sun, 26 Aug 2012 17:05:55 +0200 Message-ID: To: Hongbo Zhang Cc: Caml List Content-Type: multipart/alternative; boundary=14dae93408ab1f9bcd04c82c8ef1 Subject: Re: [Caml-list] How to profile compiler's performance --14dae93408ab1f9bcd04c82c8ef1 Content-Type: text/plain; charset=ISO-8859-1 You could try compiling a native OCaml compiler executable with profiling option (-p) (setting that up might be a pain, though). Before that you could try to only typecheck the file (option "-i") to know whether it's the type-checking or code generation that is problematic. (-i causes type printing as well, so for very large types that are internally shared it can be its own source of slowness) If it was in code generation, that would most likely only occur during when compiling to native code. Have you noticed the performance bottleneck with compilation to bytecode as well? (Of course using the natively-compiled versions of your compilers will also speed up performance, but if your generated code hits one of the source of exponential behavior of the compiler you're out of luck anyway.) On Sun, Aug 26, 2012 at 4:20 PM, Hongbo Zhang wrote: > Hi List, > I have a file which is only 410 lines, the compilation process takes > nearly 1 minutes. Before my refactoring, it's compiled very fast. > Is there a way to know which part the compiler spend most time in ? > Many Thanks > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/**wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/**ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-**bugs > > --14dae93408ab1f9bcd04c82c8ef1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You could try compiling a native OCaml compiler executable with profiling o= ption (-p) (setting that up might be a pain, though).

Before that yo= u could try to only typecheck the file (option "-i") to know whet= her it's the type-checking or code generation that is problematic. (-i = causes type printing as well, so for very large types that are internally s= hared it can be its own source of slowness)

If it was in code generation, that would most likely only occur during = when compiling to native code. Have you noticed the performance bottleneck = with compilation to bytecode as well?

(Of course using the natively-= compiled versions of your compilers will also speed up performance, but if = your generated code hits one of the source of exponential behavior of the c= ompiler you're out of luck anyway.)

On Sun, Aug 26, 2012 at 4:20 PM, Hongbo Zhan= g <bobzhang1988@gmail.com> wrote:
Hi List,
=A0 =A0I have a file which is only 410 lines, the compilation process takes= nearly 1 minutes. Before my refactoring, it's compiled very fast.
=A0 =A0Is there a way to know which part the compiler spend most time in ?<= br> =A0 =A0Many Thanks

--
Caml-list mailing list. =A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs


--14dae93408ab1f9bcd04c82c8ef1--