From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 39B5EBB84 for ; Sat, 17 Jan 2009 12:39:16 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsgBAOdRcUlIDtybkGdsb2JhbACTRj4BAQEBCQkMBxEDtyuFcw X-IronPort-AV: E=Sophos;i="4.37,280,1231110000"; d="scan'208";a="21625444" Received: from fg-out-1718.google.com ([72.14.220.155]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Jan 2009 12:39:15 +0100 Received: by fg-out-1718.google.com with SMTP id l27so908519fgb.43 for ; Sat, 17 Jan 2009 03:39:15 -0800 (PST) Received: by 10.86.57.9 with SMTP id f9mr477975fga.48.1232192355459; Sat, 17 Jan 2009 03:39:15 -0800 (PST) Received: by 10.86.73.10 with HTTP; Sat, 17 Jan 2009 03:39:15 -0800 (PST) Message-ID: <7d8707de0901170339m91341a4ob9482b1280833a3@mail.gmail.com> Date: Sat, 17 Jan 2009 12:39:15 +0100 From: "Andrej Bauer" To: "Hugo Ferreira" Subject: Re: [Caml-list] Optimizing symbolic processing code Cc: caml-list@yquem.inria.fr In-Reply-To: <4971A4CD.9070708@inescporto.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4970488C.9080104@inescporto.pt> <200901161341.53632.jon@ffconsultancy.com> <49709693.50201@inescporto.pt> <4970B398.5010100@inescporto.pt> <7d8707de0901161109y2de73536oc7a454f4f0e1ad91@mail.gmail.com> <7d8707de0901161248t39960316v46c6fa64e8001531@mail.gmail.com> <4971A4CD.9070708@inescporto.pt> X-Spam: no; 0.00; andrej:01 andrej:01 unification:01 arrays:01 arrays:01 prolog:01 symbolic:01 caml-list:01 short:01 slower:02 optimization:03 optimization:03 optimizing:03 explicit:04 interpreter:07 Dear Hugo, you have not noticed miniprolog before because it was not there until yesterday. Almost any optimization will cause my interpreter to go much faster. I think the most reasonable one to do would be to avoid explicit subtitutions during unification (since I already keep track of the environment), but then I get into the union-find business. I would not be too sure that lists are much slower than arrays when the lists and arrays are both short. You might be yet another victim of premature optimization. How does the performance of your prolog compare to my miniprolog? Judging from the care you took with your interpreter, yours should be much faster. It should be easy to run the same program on both and see what happens. Best regards, Andrej