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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id B5C2C7EC41 for ; Wed, 24 Oct 2012 18:08:03 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.17.10; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.17.10; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.17.10 as permitted sender) identity=helo; client-ip=212.227.17.10; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag0BAHwRiFDU4xEKk2dsb2JhbABEr2qSCiMBAQEBCQkLCRQDJIIlOjQLIx1dCRIGEwkJh2ADDwQHsx0DiV4Ui02GbQONV4kzkhM X-IronPort-AV: E=Sophos;i="4.80,640,1344204000"; d="scan'208";a="160270282" Received: from moutng.kundenserver.de ([212.227.17.10]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 24 Oct 2012 18:08:03 +0200 Received: from office1.lan.sumadev.de (dslb-094-219-215-011.pools.arcor-ip.net [94.219.215.11]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MFsVa-1TfvLC0T38-00Ex0s; Wed, 24 Oct 2012 18:07:52 +0200 Received: from samsung (50-193-15-57-static.hfc.comcastbusiness.net [50.193.15.57]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 037BEC00CF; Wed, 24 Oct 2012 18:07:50 +0200 (CEST) Date: Wed, 24 Oct 2012 18:07:37 +0200 From: Gerd Stolpmann Reply-To: Gerd Stolpmann To: David MENTRE Cc: Oliver Bandel , caml users In-Reply-To: X-Mailer: Balsa 2.4.11 Message-Id: <1351094857.12207.12@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:l+Mvo0Wi+ICILaOBebQ+X4wXDJkHlqgbnCazF8Ad5/+ N4PvGe557z0cBBUymGQn15F9fj94/gw/tm5A6LAf8QsNfV5aAB ja+A5XAUfVZq6Yb+Rzd+66xtwEHHOHq+1ABUvU2Lq9vLLZASlX 6jkKMfFqEuSo2HkMgnCMjLbyXxJ6/OwFNfUoOxDK0jTDzcg0Sg jT9IRncdG5nozUu/elouTMGYdwi94A6GYm9Xfwm4U/o4nJOQMJ ZucmcnqHnmrS5+VlrynB3uwuq2qLpLAUVNAxT1ftUl08mwHlKT dvbdfEg/cRUN6t3DFf73VkIwY+E06DjtVNlifHVjQ6diasggmH 8KTeoDHBwl0HOXPXF3XdAg/TBu+O0hzYCRG2GdTC6 Subject: AW: [Caml-list] Behaviour of an OCaml program: any possible GC improvement? I don't think you can do much here by just setting parameters. (Btw.,=20=20 there is no need to compile the mli's with -p.) I've seen high CPU for garbage collection frequently for mainly=20=20 functional programs. It's their nature - you generate lots of=20=20 short-living intermediate results. You can change that only by changing=20= =20 the algorithm, e.g. by caching results that would otherwise be=20=20 recomputed again. Some improvement is also possible with simple tricks,=20= =20 e.g. if you have something like Number 0 where Number is from an algebraic type, and you use this term=20=20 frequently, consider to add a constant for it, let n0 =3D Number 0 so this isn't reallocated all the time (even: if n=3D0 then n0 else=20=20 Number n). If this term is used often, this makes a noticeable=20=20 difference. Gerd Am 24.10.2012 17:09:12 schrieb(en) David MENTRE: > Hello, >=20 > 2012/10/24 David MENTRE : > > But, after recompiling everything from scratch and redoing my tests > > (taking care of erasing old gmon.out file), I have the same result > > (with calling caml_call_gc). :-( >=20 > For the sake of completeness, I installed latest OCaml 4.00.1 (for the > recall, Linux x86_64 platform), recompiled everything from scratch and > re-did my tests. I obtain roughly the same results and the same > calling caml_call_gc. :-( >=20 > There should be something obvious that I missed. >=20 > """ > Flat profile: >=20 > Each sample counts as 0.01 seconds. > % cumulative self self total > time seconds seconds calls s/call s/call name > 32.54 155.97 155.97 35791 0.00 0.01 mark_slice > 19.87 251.24 95.26 58230 0.00 0.00 sweep_slice > 12.35 310.42 59.18 88113 0.00 0.00=20=20=20 > camlMap__map_1150 > 6.66 342.34 31.92 94021 0.00 0.00=20=20=20 > caml_oldify_mopup > 6.57 373.81 31.47 1986040761 0.00 0.00=20=20=20 > caml_page_table_lookup > 4.66 396.17 22.36 3792214394 0.00 0.00=20=20=20 > caml_fl_allocate > 4.33 416.94 20.77 3799622226 0.00 0.00=20=20=20 > caml_oldify_one > 3.39 433.18 16.24 3873315118 0.00 0.00=20=20=20 > caml_fl_merge_block > 2.51 445.20 12.03 3792214239 0.00 0.00 caml_alloc_shr > 1.38 451.83 6.63 3882908903 0.00 0.00 > camlData_typing__apply_1255 > 1.26 457.88 6.05 3792214239 0.00 0.00 allocate_block > 1.20 463.62 5.74 1 5.74 5.74=20=20=20 > caml_realloc_ref_table > 0.49 465.99 2.37 188042 0.00 0.00 clear_table > 0.44 468.09 2.10 3881730105 0.00 0.00 > camlData_typing__fun_1445 > 0.42 470.08 1.99 caml_fl_reset > 0.31 471.57 1.50=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 > caml_set_allocation_policy > 0.28 472.90 1.33 896098 0.00 0.00 caml_gc_message > 0.24 474.06 1.16 74 0.02 0.02=20=20=20 > camlMap__iter_1144 > 0.22 475.12 1.06 155 0.01 0.01 caml_add_to_heap > 0.11 475.64 0.53=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 > camlData_typing__fun_1430 > 0.07 475.98 0.34 > camlData_typing__print_vset_1115 > 0.06 476.29 0.31 94021 0.00 0.00=20=20=20 > caml_oldify_local_roots > 0.04 476.46 0.17 10355866 0.00 0.00=20=20=20 > camlFormat__doprn_1525 > 0.03 476.61 0.15 95566109 0.00 0.00 caml_modify > 0.03 476.74 0.13 5946696 0.00 0.00=20=20=20 > camlFormat__kpr_1514 > 0.03 476.86 0.12 10179867 0.00 0.00 > camlFormat__advance_loop_1173 > 0.02 476.97 0.11 16452591 0.00 0.00 > camlFormat__format_pp_token_1134 > 0.02 477.05 0.08 15459066 0.00 0.00 caml_putblock > 0.02 477.13 0.08 16452612 0.00 0.00=20=20=20 > camlFormat__add_queue_1087 > [...] > granularity: each sample hit covers 2 byte(s) for 0.00% of 479.32=20=20 > seconds >=20 > index % time self children called name > 0.00 0.11 25/94021 caml_alloc_small [75] > 0.00 0.56 133/94021 caml_alloc_string=20=20 > [51] > 0.02 394.48 93863/94021=20=20=20=20=20=20=20=20 > caml_garbage_collection [3] > [1] 82.4 0.02 395.15 94021 caml_minor_collection [1] > 0.02 297.93 94021/94021=20=20=20=20=20=20=20=20 > caml_major_collection_slice [4] > 0.01 97.19 188042/188042=20=20=20=20=20=20=20 > caml_empty_minor_heap [7] > 0.00 0.00 94021/94021 caml_final_do_calls=20= =20 > [353] > ----------------------------------------------- > > [2] 82.3 0.04 394.50 caml_call_gc [2] > 0.00 394.50 93863/93863=20=20=20=20=20=20=20=20 > caml_garbage_collection [3] > ----------------------------------------------- > 0.00 394.50 93863/93863 caml_call_gc [2] > [3] 82.3 0.00 394.50 93863 caml_garbage_collection=20= =20 > [3] > 0.02 394.48 93863/94021=20=20=20=20=20=20=20=20 > caml_minor_collection [1] > 0.00 0.00 93863/97401 > caml_process_pending_signals [352] > ----------------------------------------------- > 0.02 297.93 94021/94021=20=20=20=20=20=20=20=20 > caml_minor_collection [1] > [4] 62.2 0.02 297.93 94021=20=20=20=20=20=20=20=20=20=20 > caml_major_collection_slice [4] > 155.97 29.41 35791/35791 mark_slice [5] > 95.26 16.33 58230/58230 sweep_slice [6] > 0.84 0.00 564126/896098 caml_gc_message [43] > 0.00 0.10 4652/4652 start_cycle [76] > 0.00 0.01 4651/4651=20=20=20=20=20=20=20=20=20 > caml_compact_heap_maybe [135] > ----------------------------------------------- > 155.97 29.41 35791/35791=20=20=20=20=20=20=20=20 > caml_major_collection_slice [4] > [5] 38.7 155.97 29.41 35791 mark_slice [5] > 29.31 0.00 1849494323/1986040761 > caml_page_table_lookup [16] > 0.11 0.00 71582/896098 caml_gc_message [43] > 0.00 0.00 1/1 realloc_gray_vals=20=20 > [269] > 0.00 0.00 4652/4652 caml_final_update=20=20 > [377] > 0.00 0.00 4652/4653 caml_fl_init_merge=20=20 > [375] > ----------------------------------------------- > 95.26 16.33 58230/58230=20=20=20=20=20=20=20=20 > caml_major_collection_slice [4] > [6] 23.3 95.26 16.33 58230 sweep_slice [6] > 16.24 0.00 3873315117/3873315118=20=20=20=20=20=20 > caml_fl_merge_block [18] > 0.09 0.00 58230/896098 caml_gc_message [43] > 0.00 0.00 1/1=20=20=20=20=20=20=20=20=20=20=20= =20 > caml_finalize_channel [477] > ----------------------------------------------- > 0.01 97.19 188042/188042=20=20=20=20=20=20=20 > caml_minor_collection [1] > [7] 20.3 0.01 97.19 188042 caml_empty_minor_heap [7] > 31.92 62.08 94021/94021 caml_oldify_mopup [8] > 2.37 0.00 188042/188042 clear_table [29] > 0.31 0.07 94021/94021=20=20=20=20=20=20=20=20 > caml_oldify_local_roots [58] > 0.28 0.00 188042/896098 caml_gc_message [43] > 0.05 0.10 9383144/3799622226 caml_oldify_one=20=20 > [14] > 0.00 0.00 188042/188042=20=20=20=20=20=20=20 > caml_final_empty_young [344] > ----------------------------------------------- > 31.92 62.08 94021/94021=20=20=20=20=20=20=20=20 > caml_empty_minor_heap [7] > [8] 19.6 31.92 62.08 94021 caml_oldify_mopup [8] > 20.71 41.37 3787931806/3799622226=20=20=20=20=20=20 > caml_oldify_one [14] > ----------------------------------------------- > [...] > """ >=20 > Best regards, > david >=20 > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >=20 >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------=