[#16708] includedir — nobu.nakada@...
なかだです。
[#16732] sharing sub-regexp — Tanaka Akira <akr@...17n.org>
Oniguruma についてひとつ要望があります。
Tanaka Akiraさんの<hvopu1hxfyd.fsf@coulee.a02.aist.go.jp>から
まつもと ゆきひろです
In article <1017890618.302241.17865.nullmailer@ev.netlab.jp>,
Tanaka Akiraさんの<hvo7knn93ug.fsf@coulee.a02.aist.go.jp>から
In article <20020405044506.D4784349@helium.ruby-lang.org>,
Tanaka Akiraさんの<hvopu1e4omy.fsf@coulee.a02.aist.go.jp>から
In article <20020410025054.C8DF0915@helium.ruby-lang.org>,
In article <hvor8lnchak.fsf@coulee.a02.aist.go.jp>,
前田です。
In article <87pu15z80q.wl@studly.priv.netlab.jp>,
前田です。
In article <87g01x1e6m.wl@studly.priv.netlab.jp>,
西山和広です。
In article <20020416180631.988E.ZN@mbf.nifty.com>,
前田です。
In article <87u1qaj0xe.wl@studly.priv.netlab.jp>,
前田です。
まつもと ゆきひろです
In article <1019116103.420173.12691.nullmailer@picachu.netlab.jp>,
前田です。
なかだです。
In article <200204181023.g3IANgM21124@sharui.nakada.kanuma.tochigi.jp>,
まつもと ゆきひろです
In article <1019140164.869863.14833.nullmailer@picachu.netlab.jp>,
[#16757] === — "Akinori MUSHA" <knu@...>
Array, Hash, Proc などで、 === が以下のように定義されていると
[#16761] StringIO — tadf@...
ふなばです。
なかだです。
ふなばです。
なかだです。
ふなばです。
青山です。
まつもと ゆきひろです
In article <1022740594.117106.6073.nullmailer@picachu.netlab.jp>,
前田です。
In article <874rgqdt3x.wl@studly.priv.netlab.jp>,
青山です。
まつもと ゆきひろです
青山です。
まつもと ゆきひろです
青山です。
まつもと ゆきひろです
青山です。
[#16776] Ruby 1.7.2 segfault — takuma ozawa <metal@...>
小澤といいます。
なかだです。
[#16790] Ruby Shim — "Akinori MUSHA" <knu@...>
1.7 early access kit という仮称で提案した構想ですが、先ほど
新井です。
At Tue, 9 Apr 2002 02:12:27 +0900,
なかだです。
[#16816] remove_const: cannot remove constant — Koji Arai <JCA02266@...>
新井です。
[#16833] math.c 1.10 — "U.Nakamura" <usa@...>
こんにちは、なかむら(う)です。
まつもと ゆきひろです
さくです。
なかだです。
まつもと ゆきひろです
[#16868] make error on debian potato — Wakou Aoyama <wakou@...>
青山です。
[#16869] Makefiles dependency — nobu.nakada@...
なかだです。
わたなべです。
なかだです。
わたなべです。
なかだです。
わたなべです。
なかだです。
[#16894] compile failure in process.c, setpgrp() & setpgid() — Ryo HAYASAKA <ryoh@...>
早坂@北陸先端です.
[#16923] Module::new with block is useful? — "Shin'ya Adzumi" <adzumi@...>
あづみです。
[#16978] Re: [rubyist:1343] Re: another sample for the Method — Koji Arai <JCA02266@...>
新井です。
[#16989] making Proc in C (Re: [rubyist:1356] Re: another sample for the Method) — nobu.nakada@...
なかだです。
[ruby-dev:16803] Re: StringIO
なかだです。
At Tue, 9 Apr 2002 10:12:46 +0900,
tadf@kt.rim.or.jp wrote:
> > しかし、さすがにそこまで遅くはなさそうなんですが。
>
> なんでかなあ、と思って、Linux でも試してみました。Linux では、なかださ
> んの言うとおりのようです。Linux のほうがどこか (メモリ管理とか) 優れて
> いるのか、FreeBSD の出来が悪いのか。ともかく、Linux では問題ないが、
> FreeBSD ではやけに遅い、ということのようです (他の環境ではどうなのか)。
うーん、システム固有の癖? となると、ちょっとボトルネックが分か
らないなぁ。プロファイル取れるとありがたいんですが。
> ただ、FreeBSD でも、1.6 の String は遅いが、1.7 のほうは速い、というこ
> とがあるので (偶然ではなく、意識してやってると思う)、なにかの工夫で、
> 劇的に改善されそうな気がします。
rb_str_modify()の回数を減らすのとrb_str_cat()を使うようにしたと
ころ手元では30%弱くらい速くなったんですが、どうでしょうか。まだ
あまり劇的とはいえないかも知れませんが。
Index: ext/stringio/stringio.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/stringio/stringio.c,v
retrieving revision 1.4
diff -u -2 -p -r1.4 stringio.c
--- ext/stringio/stringio.c 2002/03/18 13:20:54 1.4
+++ ext/stringio/stringio.c 2002/04/09 02:17:55
@@ -126,5 +126,4 @@ check_modifiable(ptr)
rb_raise(rb_eIOError, "not modifiable string");
}
- rb_str_modify(ptr->string);
}
@@ -549,4 +548,5 @@ strio_ungetc(self, ch)
(unsigned char)cc) {
check_modifiable(ptr);
+ rb_str_modify(ptr->string);
RSTRING(ptr->string)->ptr[ptr->pos] = cc;
}
@@ -741,8 +741,16 @@ strio_write(self, str)
ptr->pos = RSTRING(ptr->string)->len;
}
- if (ptr->pos + len > RSTRING(ptr->string)->len) {
- rb_str_resize(ptr->string, ptr->pos + len);
+ if (ptr->pos == RSTRING(ptr->string)->len) {
+ rb_str_cat(ptr->string, RSTRING(str)->ptr, len);
}
- rb_str_update(ptr->string, ptr->pos, len, str);
+ else {
+ if (ptr->pos + len > RSTRING(ptr->string)->len) {
+ rb_str_resize(ptr->string, ptr->pos + len);
+ }
+ else {
+ rb_str_modify(ptr->string);
+ }
+ rb_str_update(ptr->string, ptr->pos, len, str);
+ }
ptr->pos += len;
return LONG2NUM(len);
@@ -768,4 +776,7 @@ strio_putc(self, ch)
if (ptr->pos >= RSTRING(ptr->string)->len) {
rb_str_resize(ptr->string, ptr->pos + 1);
+ }
+ else {
+ rb_str_modify(ptr->string);
}
RSTRING(ptr->string)->ptr[ptr->pos++] = c;
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦