From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.lisp.guile.user Subject: Re: Performance Date: Sat, 19 Jun 2010 17:05:50 +0200 Organization: Decebal Computing Message-ID: <87r5k3qcz5.fsf@linux-lqcw.site> References: <87vd9gawv6.fsf@linux-lqcw.site> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1276959932 19407 80.91.229.12 (19 Jun 2010 15:05:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Jun 2010 15:05:32 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 19 17:05:31 2010 connect(): No such file or directory Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OPzbp-0002sG-Ak for guile-user@m.gmane.org; Sat, 19 Jun 2010 17:05:25 +0200 Original-Received: from localhost ([127.0.0.1]:44821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPzbo-0002je-RE for guile-user@m.gmane.org; Sat, 19 Jun 2010 11:05:24 -0400 Original-Received: from [140.186.70.92] (port=53384 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPzbh-0002jX-Ps for guile-user@gnu.org; Sat, 19 Jun 2010 11:05:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPzbf-0008Ag-NR for guile-user@gnu.org; Sat, 19 Jun 2010 11:05:16 -0400 Original-Received: from smtp-vbr1.xs4all.nl ([194.109.24.21]:3971) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPzbf-0008AS-G8 for guile-user@gnu.org; Sat, 19 Jun 2010 11:05:15 -0400 Original-Received: from linux-lqcw.site (84-53-123-169.wxdsl.nl [84.53.123.169]) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id o5JF5CAA044005 for ; Sat, 19 Jun 2010 17:05:13 +0200 (CEST) (envelope-from Cecil@decebal.nl) X-Homepage: http://www.decebal.nl/ In-Reply-To: (Andy Wingo's message of "Sat, 19 Jun 2010 11:16:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7903 Archived-At: Op zaterdag 19 jun 2010 11:16 CEST schreef Andy Wingo: > On Fri 18 Jun 2010 22:50, Cecil Westerhof writes: > >> Why is this so expensive? > > The general answer to this question can be found by profiling. You > should factor your code into a function, then from the repl: > > ,profile (call-my-function) > > I wonder, perhaps we should have a --profile command-line flag... When calling my script with: dummy.scm "temp/input" "dummy.log" "^ +" "1234567890" it is just executed. When starting Guile, I give: (load "bin/dummy.scm") and then: (main "temp/input" "dummy.log" "^ +" "1234567890") and I get: Backtrace: In standard input: 10: 0* [main "temp/input" "dummy.log" "^ +" "1234567890"] standard input:10:1: In procedure main in expression (main "temp/input" "dummy.log" ...): standard input:10:1: Wrong number of arguments to # ABORT: (wrong-number-of-args) when I use: (main ("temp/input" "dummy.log" "^ +" "1234567890")) I get: Backtrace: In standard input: 11: 0* [main ... 11: 1* ["temp/input" "dummy.log" "^ +" "1234567890"] standard input:11:7: In expression ("temp/input" "dummy.log" "^ +" ...): standard input:11:7: Wrong type to apply: "temp/input" ABORT: (misc-error) So how should I call it from the REPL? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof