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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id B8B607EE51 for ; Sun, 14 Apr 2013 15:26:42 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of syshen@nudt.edu.cn) identity=pra; client-ip=61.187.54.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="syshen@nudt.edu.cn"; x-sender="syshen@nudt.edu.cn"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of syshen@nudt.edu.cn) identity=mailfrom; client-ip=61.187.54.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="syshen@nudt.edu.cn"; x-sender="syshen@nudt.edu.cn"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nudt.edu.cn) identity=helo; client-ip=61.187.54.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="syshen@nudt.edu.cn"; x-sender="postmaster@nudt.edu.cn"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhgLACitalE9uzYLdGdsb2JhbABQhmy9aIFCDgEMFQg8ghaBHgkBAj5fJIgCjTiMMo5MCIhEiRGRSIEXA4kDjgKUKYIb X-IPAS-Result: AhgLACitalE9uzYLdGdsb2JhbABQhmy9aIFCDgEMFQg8ghaBHgkBAj5fJIgCjTiMMo5MCIhEiRGRSIEXA4kDjgKUKYIb X-IronPort-AV: E=Sophos;i="4.87,470,1363129200"; d="scan'208";a="13192100" Received: from mail.nudt.edu.cn (HELO nudt.edu.cn) ([61.187.54.11]) by mail2-smtp-roc.national.inria.fr with ESMTP; 14 Apr 2013 15:26:40 +0200 Received: by ajax-webmail-coremail.nudt.edu.cn (Coremail) ; Sun, 14 Apr 2013 21:23:28 +0800 (GMT+08:00) Date: Sun, 14 Apr 2013 21:23:28 +0800 (GMT+08:00) From: =?GBK?B?yfLKpNPu?= To: caml-list Message-ID: <1cbcde35.47c9.13e08b6f72a.Coremail.syshen@nudt.edu.cn> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_63583_1267369815.1365945808682" X-Originating-IP: [113.246.242.103] X-Priority: 3 X-Mailer: Coremail Webmail Server Version 4.0.5a build 20121109(20529.5019.5013) Copyright (c) 2002-2013 www.mailtech.cn nudt-out X-SendMailWithSms: false X-CM-TRANSID:AQAAf0A5f0TRrWpR_oMfAA--.4712W X-CM-SenderInfo: xv1vxvnq6q3vvwohv3gofq/1tbiAQAIE1C8Ui+8MAAOsJ X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VW5Jw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= Subject: [Caml-list] [OCAML]:: the cost of List.length ------=_Part_63583_1267369815.1365945808682 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit Dear all: I have a program that run very fast. Recently, I add a call to List.length to this old program's inner loop, which make it significantly slower. So what is the cost of List.length, is it liner to the size of the list? or is a const? Shen ------=_Part_63583_1267369815.1365945808682 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit Dear all:

I have a program that run very fast.

Recently, I add a call to List.length to this old program's inner loop, which make it significantly slower.

So what is the cost of List.length, is it liner to the size of the list? or is a const?

Shen
------=_Part_63583_1267369815.1365945808682--