From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: wip-ports-refactor Date: Tue, 19 Apr 2016 10:00:00 +0200 Message-ID: <878u0ahvun.fsf@pobox.com> References: <87twjempnf.fsf@pobox.com> <87zisw9tju.fsf@gnu.org> <8760vgmxfy.fsf@pobox.com> <87a8ksecpg.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1461052863 24513 80.91.229.3 (19 Apr 2016 08:01:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2016 08:01:03 +0000 (UTC) Cc: guile-devel To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Apr 19 10:00:55 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1asQac-0007a8-Cm for guile-devel@m.gmane.org; Tue, 19 Apr 2016 10:00:54 +0200 Original-Received: from localhost ([::1]:53413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asQaW-00027W-Ou for guile-devel@m.gmane.org; Tue, 19 Apr 2016 04:00:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asQZy-0001D7-7n for guile-devel@gnu.org; Tue, 19 Apr 2016 04:00:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asQZu-0000Xt-Of for guile-devel@gnu.org; Tue, 19 Apr 2016 04:00:13 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:61477 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asQZu-0000Xa-Kq; Tue, 19 Apr 2016 04:00:10 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id A652CF917; Tue, 19 Apr 2016 04:00:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Tzyme2ZFgedG kTUOq8sleC3qlMA=; b=bMNpuT6WxbAcZ9MJvoi4s8zgy1gRxxLooAD8qdd8EtV9 Rb5QuWQooPRiRwU/I8JKg1qRTscvIi8nWf5ZsCk5stfTUggjsHOCSlkuZ6LvjNo6 7n+GM1NDR52CO+onuE4+Fb7Y0GUyPPZg8HXfLsh9wkNDTPtdixr2tjVjpiONxAo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=TLXFnc czjb9G8AIN9WcW4UZBIcE7MeCJdgazndD6zMXqpsenT9gJQHRZSadtLTSCCA3sKs hbIYnyD9eulmYM/TCXgogUv84QTFnLHlLcOlGZNYbnhTU7wzUHaev5bYwnrq+CKO qufZnmLKx0JHRulhz+I9mFJisGnQ20Xm/rEaA= Original-Received: from pb-sasl1. (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 9ECD8F916; Tue, 19 Apr 2016 04:00:09 -0400 (EDT) Original-Received: from clucks (unknown [91.117.99.155]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id C61EEF911; Tue, 19 Apr 2016 04:00:07 -0400 (EDT) In-Reply-To: <87a8ksecpg.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 17 Apr 2016 12:44:59 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Pobox-Relay-ID: BBB5D990-0604-11E6-A042-0D7A5CA9D4A7-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18291 Archived-At: Hi, On Sun 17 Apr 2016 12:44, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo skribis: > >> I want to test four things. >> >> ;; 1. How long a loop up to 10 million takes (baseline measurement). >> (let ((port (open-input-string "s"))) (do-times #e1e7 1)) >> >> ;; 2. A call to a simple Scheme function. >> (define (foo port) 42) >> (let ((port (open-input-string "s"))) (do-times #e1e7 (foo port))) >> >> ;; 3. A call to a port subr. >> (let ((port (open-input-string "s"))) (do-times #e1e7 (port-line por= t))) >> >> ;; 4. A call to a port subr that touches the buffer. >> (let ((port (open-input-string "s"))) (do-times #e1e7 (peek-char por= t))) >> >> The results: >> >> | baseline | foo | port-line | peek-char >> ------------------+----------+--------+-----------+---------- >> guile 2.0 | 0.269s | 0.845s | 1.067s | 1.280s >> guile master | 0.058s | 0.224s | 0.225s | 0.433s >> wip-port-refactor | 0.058s | 0.220s | 0.226s | 0.375s > > Oh, nice! (By =E2=80=9Cprohibitively slow=E2=80=9D I was referring to 2.= 0.) > > For =E2=80=98peek-char=E2=80=99, isn=E2=80=99t there also the fact that s= tring ports in 2.2 are > UTF-8 by default, so we get the fast path, whereas in 2.0 there > =E2=80=98%default-port-encoding=E2=80=99, which could be something else l= eading to the > slow path? I tried making sure the string port was a UTF-8 port but that made no difference to the 2.0 peek-char times. I suspect this is because I ran it at the REPL, which had done a setlocale() already. But perhaps that's not the right explanation. Andy