From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA26408; Sat, 12 Oct 2002 10:49:32 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA26354 for ; Sat, 12 Oct 2002 10:49:31 +0200 (MET DST) Received: from chimta01.algx.net (chimta01.algx.net [216.99.233.34]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9C8nU522386 for ; Sat, 12 Oct 2002 10:49:30 +0200 (MET DST) Received: from d227.focal10.interaccess.com (d227.focal10.interaccess.com [207.208.141.227]) by chimmx01.algx.net (iPlanet Messaging Server 5.1 HotFix 1.4 (built Aug 5 2002)) with SMTP id <0H3V0012O1TQC9@chimmx01.algx.net> for caml-list@inria.fr; Sat, 12 Oct 2002 03:49:10 -0500 (CDT) Date: Sat, 12 Oct 2002 08:50:30 +0000 (GMT) From: olczyk@interaccess.com (Thaddeus L. Olczyk) Subject: Re: [Caml-list] ICFP 2002 Programming Contest Write-up? In-reply-to: <86hefttv39.fsf@laurelin.dementia.org> To: caml-list@inria.fr Reply-to: olczyk@interaccess.com Message-id: <3da8e1a1.387903562@smtp.interaccess.com> Organization: stickit@nospammers.com MIME-version: 1.0 X-Mailer: Forte Agent 1.5/32.451 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <3da521d4.207730921@smtp.interaccess.com> <200210100725.DAA17114@apakabar.cc.columbia.edu> <20021011030441T.sumii@yl.is.s.u-tokyo.ac.jp> <20021011040308F.sumii@yl.is.s.u-tokyo.ac.jp> <86hefttv39.fsf@laurelin.dementia.org> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 11 Oct 2002 01:15:06 -0400 (21.882 UMT), John Prevost wrote: >>>>>> "es" == eijiro sumii writes: > > es> - On the other hand, the CPU times are quite different: we > es> are more than 70 times faster! This is surprising > es> enough---even though speed was not a goal in the task and even > es> though the CPU times may be somewhat imprecise as the judges > es> say---considering the other entry is written in (raw) C. > >Well, I took a look at the 2nd-place C program a bit--it's *designed* >to use as much CPU time as possible, up to the limit. Whenever it has >time left over after planning, it uses that left over time to improve >its map of the world. Apparently in the default setup, it will always >take very near to one full CPU second per move. > >That might explain the "CPU-hungry" nature of the entry, even though >it's written in C. > This is not a good strategy. The rules say that it is averabe time for moves that counts. So it doesn't matter when you do the calculation. If you need something precaculated then you should do it at the beginning, if you don't need it imeadiately, then you should delay calculating until you need it. This saves CPU time. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners