<html><head><style>P {margin-top:2px;margin-bottom:2px;}</style></head><body><div style="font-size:10pt; font-family:Gulim,AppleGothic,sans-serif;"><P>There are too much peformance differences between srfi-6 and R6RS string port<BR>library in comparison with other R6RS conforming implementation.<BR>I'd like to know whether they result from R6RS library itself or Mzscheme.</P>
<P> </P>
<P>Welcome to MzScheme v4.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.<BR>> (define-syntax dotimes<BR> (syntax-rules ()<BR> ((dotimes (i count) b d ...)<BR> (do ((i 0 (+ i 1)))<BR> ((= i count))<BR> b d ...))<BR> ((dotimes count b d ...)<BR> (dotimes (i count) b d ...))))</P>
<P>> (time (dotimes 1000000 (get-output-string (let ((port (open-output-string))) (write "abc" port) port))))<BR>cpu time: 1343 real time: 1343 gc time: 126</P>
<P>> (require rnrs)</P>
<P>> (time (dotimes 1000000 (call-with-string-output-port (lambda (port) (write "abc" port) port))))<BR>cpu time: 21109 real time: 21109 gc time: 4519</P>
<P>> (time (dotimes 1000000 (call-with-values (lambda () (open-string-output-port)) (lambda (port proc) (write "abc" port) proc))))<BR>cpu time: 22625 real time: 22625 gc time: 7346</P>
<P>> (time (dotimes 1000000 (get-output-string (let ((port (open-output-string))) (write "abc" port) port))))<BR>put-datum: expected argument of type <textual port>; given #<output-port:string></P>
<P><BR>Ypsilon 0.9.6-update3 Copyright (c) 2008 Y.Fujita, LittleWing Company Limited.<BR>> (import (time))<BR>> (import (srfi srfi-6))</P>
<P>> (time (dotimes 1000000 (get-output-string (let ((port (open-output-string))) (write "abc" port) port))))</P>
<P>;; 2.375 real 4.28125 user 0.015625 sys<BR>> (time (dotimes 1000000 (call-with-string-output-port (lambda (port) (write "abc" port) port))))</P>
<P>;; 3.656252 real 5.8125 user 0.03125 sys<BR>> (time (dotimes 1000000 (call-with-values (lambda () (open-string-output-port)) (lambda (port proc) (write "abc" port) proc))))</P>
<P>;; 2.546875 real 4.4375 user 0.0625 sys<BR></P>
<P>--</P></div></body></html><!--navermail.footer.start-->
<!--navermail.footer.end-->
<table style='display:none'><tr><td><IMG SRC="http://mail2.naver.com/newmailcheck/FPbsp63n1Bt/F4UrM4MYMxtqpxMrKxC0FAiSKxv9pog9MqbXM6JoM6igMxEwKAu/hoRmWHtRbrFcp690tzwGbXt5MXK5MNiT+r/5p639.gif" border=0></td></tr></table>