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 DD39D7ED45 for ; Sun, 24 Jun 2012 21:18:42 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMCAKxm50/AbSoIe2dsb2JhbABEpSmQUyIBARYmBCOCGAEBBAFsAggDBQsLJQ8SISQSBhMSCodhAwYFBAeuCAMKiU6KUIZlA41Lh2KBE4gUgVyHYA X-IronPort-AV: E=Sophos;i="4.77,467,1336341600"; d="scan'208";a="164220309" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Jun 2012 21:18:42 +0200 X-Envelope-From: oliver@first.in-berlin.de Received: from localhost (okapi.in-berlin.de [192.109.42.117]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id q5OJIe4F007436; Sun, 24 Jun 2012 21:18:40 +0200 Received: from e178019039.adsl.alicedsl.de (e178019039.adsl.alicedsl.de [85.178.19.39]) by webmail.in-berlin.de (Horde Framework) with HTTP; Sun, 24 Jun 2012 21:18:40 +0200 Message-ID: <20120624211840.124466j26yxz6rkg@webmail.in-berlin.de> Date: Sun, 24 Jun 2012 21:18:40 +0200 From: "Oliver Bandel" To: "Diego Olivier Fernandez Pons" Cc: "Gabriel Scherer" , caml-list References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) 4.3.3 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] print_int is too slow what about print_string( string_of_int !length ^ "\n") ?? Zitat von "Diego Olivier Fernandez Pons" : > Gabriel, > >> I have no time for empirical checks right now, but is the problem >> really with print_int, or does replacing (print_newline ()) by >> (print_string "\n") similarly improves performances? That may very >> well be related to when buffering happens. > > You are right, it's print_newline() that is causing the problem > > (> 2s) print_int !length; print_newline () > (0.27s) printf.printf "%i\n" !length > (0.21s) print_int !length; print_string "\n" > > I know that is not much of a difference... but it's the IOI training > exercises and time limits are hard. > Besides on this case that difference was larger than what I could gain > with smarter algorithms or better data structure (I tried a dozen > variants) > > Diego Olivier > > -- > 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 > >