From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0KEgJcU011099 for ; Fri, 20 Jan 2012 15:42:19 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AikCAJZ8GU/AbSoIe2dsb2JhbABDhQSmWYIlIgEBFiYEIYFyAQEFI1YQCwkFCgICJgICFBgxiBGmbZFjE4EciWEzYwSNVodCkk0 X-IronPort-AV: E=Sophos;i="4.71,542,1320620400"; d="scan'208";a="140751834" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jan 2012 15:42:14 +0100 X-Envelope-From: oliver@first.in-berlin.de Received: from first (e178003192.adsl.alicedsl.de [85.178.3.192]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id q0KEgDaI014570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Jan 2012 15:42:13 +0100 Received: by first (Postfix, from userid 1000) id 06D65154036C; Fri, 20 Jan 2012 15:42:12 +0100 (CET) Date: Fri, 20 Jan 2012 15:42:12 +0100 From: oliver To: Edgar Friendly Cc: caml-list@inria.fr Message-ID: <20120120144212.GB3591@siouxsie> References: <20120120093834.GB1870@siouxsie> <4F197343.8070704@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4F197343.8070704@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] is there a more concise way to write this? On Fri, Jan 20, 2012 at 08:59:31AM -0500, Edgar Friendly wrote: > On 01/20/2012 04:38 AM, oliver wrote: > >More concise does not always mean better readable or more performant. > >You apply the same kind of selection for both values. > > I can't measure readability, but I did throw together a quick > benchmark to test the different methods. Please take no offense at > this - I'm sure that the responses were headed much more towards > readability than performance, Thats not offending, the result is fine for me. :-) I preferred the pattern-match version, because I like things to be displayed in tables. ;-) My version (option type and folding on lists) you did not implemented, but maybe it would have been my work to do that. But I liked the pattern macthing way. That it also is the fastest way, is a fine result. :-) I hope you used more than one call of the function and used average / stddev on your values to get reliable results... I don't know your Bench-module. Where is it from? Ciao, Oliver