[#18987] WinCE patch — "uema2@..." <mail@...2.cjb.net>
植松と申します。
なかだです。
[#18989] caller(0) from toplevel — "NAKAMURA, Hiroshi" <nahi@...>
なひです。
[#19002] Why to_ary is defined in URI? — Tanaka Akira <akr@...17n.org>
ふと気がついたのですが、URI を puts すると、
まつもと ゆきひろです
In article <1039071939.726071.943.nullmailer@picachu.netlab.jp>,
[#19009] ipaddr.rb — "Akinori MUSHA" <knu@...>
ipaddr.rb というライブラリを rough に入れました。IP アドレスを
[#19010] Rational#zero? causes SystemStackError — "NAKAMURA, Hiroshi" <nakahiro@...>
なひです。
まつもと ゆきひろです
[#19011] open-uri - very easy net access library — Tanaka Akira <akr@...17n.org>
HTTP, FTP に簡単にアクセスするための open-uri というライブラリを作って
西山和広です。
なひです。
In article <032b01c2a0fb$2f9981a0$96222fc0@godiva>,
[#19030] NT -> _WIN32 patch — "uema2@..." <mail@...2.cjb.net>
植松です。
[#19066] ruby 1.6.9 preview4 予告 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
なひです。自明ですけど一応。。。
At Fri, 13 Dec 2002 15:28:47 +0900,
In article <86adj6fmj1.wl@archon.local.idaemons.org>,
うえのです。
まつもと ゆきひろです
うえのです。
At Tue, 17 Dec 2002 23:09:36 +0900,
なひです。
[#19072] ruby 1.6.8 bug? on freebsd 4.7 stable — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#19083] Re: [ruby-cvs] ruby: * file.c (utimbuf): need to define for VC++. — WATANABE Hirofumi <eban@...>
わたなべです。
こんにちは、なかむら(う)です。
わたなべです。
こんにちは、なかむら(う)です。
こんにちは、なかむら(う)です。
わたなべです。
[#19104] lib/mkmf.rb; Shellwords.shellwords — WATANABE Hirofumi <eban@...>
わたなべです。
[#19116] allocator (Re: core dump by removing String.allocate (PR#369)) — nobu.nakada@...
なかだです。
まつもと ゆきひろです
[#19127] Re: 1.6.8-preview4 build failed (on Vine Linux 2.1.5) (PR#373) — nobu.nakada@...
なかだです。
わたなべです。
なかだです。
なかだです。
わたなべです。
[#19147] Ruby 1.7 での Object#to_a — ABE Shigeru <shiger-a@...>
みなさん、こんにちは。阿部といいます。
[#19163] [PATCH] ruby-{forward,backward}-sexp — nobu.nakada@...
なかだです。
[#19169] version.h — WATANABE Hirofumi <eban@...>
わたなべです。
[#19181] regular expression: begin position anchor — "K.Kosako" <kosako@...>
正規表現のテストスクリプトを作成していて、
[#19186] Process::times による SEGV? — ABE Shigeru <shiger-a@...>
こんにちは。阿部です。
[#19196] replace 1.7 with 1.8 in macros under wince/ — Ryo HAYASAKA <ryoh@...>
早坂@北陸先端といいます.
植松です。
植松です。
[#19198] ruby-1.8.0 / yield(nil)とyield()のちがい — m_seki@...
なかだです。
まつもと ゆきひろです
まつもと ゆきひろです
まつもと ゆきひろです
In article <1041383157.631472.21307.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1041394108.920587.21729.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1041420724.492653.22355.nullmailer@picachu.netlab.jp>,
咳といいます。
In article <537C480E-1D9A-11D7-A418-000393814512@mva.biglobe.ne.jp>,
咳といいます。
まつもと ゆきひろです
In article <1041521460.248415.5532.nullmailer@picachu.netlab.jp>,
まつもと ゆきひろです
In article <1041554769.892566.13140.nullmailer@picachu.netlab.jp>,
[#19200] replace-resolv.rb 使用で内部ループ — Teruki Shigitani <shigitani@...>
鴫谷と申します。
[#19221] Re: [ruby-cvs] ruby: * instruby.rb: use getopts.rb. — "U.Nakamura" <usa@...>
こんにちは、なかむら(う)です。
わたなべです。
[#19233] Re: [1.8] speed — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
うえのです。
[#19239] CRLF (here document) — Daisuke Aoki <dai@...>
青木@横浜です。
青木@横浜です。
わたなべです。
なかだです。
[#19258] Re: [ruby-cvs] ruby: * node.h (struct RNode): Change argc from int to long. Otherwize — "Akinori MUSHA" <knu@...>
At Tue, 31 Dec 2002 19:24:29 +0000,
[ruby-dev:19252] Re: [1.8] speed
なかだです。
At Tue, 31 Dec 2002 01:42:16 +0900,
Tanaka Akira wrote:
> > 一度大量にオブジェクトを作って解放すると live に対して freed が
> > 大きくなり、malloc_limit が増えにくくなることが考えられます。
>
> 私も今の freed はあんまりアプリケーションのメモリ使用量を推定するには
> 向いていない値な気がします。
手抜きです。実は最初、garbageという変数で解放するオブジェクトを
数えるようにしてみたんですが、ほとんど制限にならなかったんで
freedを使ってお茶を濁しました。
> もちろん、malloc/realloc 量とオブジェクト数の増加量に相関があることが
> 前提ですけど。
あることはあると思いますが、あまり正確ではないでしょう。あくま
でも目安程度ってことで。
At Tue, 31 Dec 2002 02:33:06 +0900,
Tanaka Akira wrote:
> ふと思ったのですが、もしかしたら、メモリの量だけで制御するのではなく、
> GC の時間と間隔も考慮すべきなのかも知れません。GC にかかる時間は測れま
> すから、GC 間隔を制御すれば割合を一定以下に抑えることは可能です。そし
> て、そういう制御をすれば GC による速度低下を(メモリの量による制御より
> も)もっと直接的に制御できます。例えば、GC にかかった時間と同じだけの時
> 間は GC を起動しないようにすれば、GC の割合は 50% に抑えられるのは自明
> です。
試してみました。[ruby-talk:59662]などはかなり向上しますが、
[ruby-dev:18482]や[ruby-dev:19242]あたりはほとんど変わらないよ
うです。比率を調整するとちょっと違うかも知れませんが。
Index: configure.in
===================================================================
RCS file: /cvs/ruby/src/ruby/configure.in,v
retrieving revision 1.158
diff -u -2 -p -r1.158 configure.in
--- configure.in 26 Dec 2002 15:12:06 -0000 1.158
+++ configure.in 30 Dec 2002 21:23:18 -0000
@@ -378,5 +377,5 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid
setitimer setruid seteuid setreuid setresuid setproctitle\
setrgid setegid setregid setresgid pause lchown lchmod\
- getpgrp setpgrp getpgid setpgid getgroups getpriority getrlimit\
+ getpgrp setpgrp getpgid setpgid getgroups getpriority getrlimit getrusage\
dlopen sigprocmask sigaction _setjmp setsid telldir seekdir fchmod\
mktime timegm cosh sinh tanh)
Index: gc.c
===================================================================
RCS file: /cvs/ruby/src/ruby/gc.c,v
retrieving revision 1.114
diff -u -2 -p -r1.114 gc.c
--- gc.c 29 Dec 2002 14:51:22 -0000 1.114
+++ gc.c 30 Dec 2002 21:27:14 -0000
@@ -874,4 +874,30 @@ size_of_table(tbl)
}
+#ifdef HAVE_GETRUSAGE
+static struct timeval *
+period(t)
+ struct timeval *t;
+{
+ struct rusage u;
+ getrusage(RUSAGE_SELF, &u);
+ *t = u.ru_utime;
+ return t;
+}
+
+static double
+laptime(t1, t2)
+ const struct timeval *t1, *t2;
+{
+ return (t1->tv_sec - t2->tv_sec) + (t1->tv_usec - t2->tv_usec) / 1000000.0;
+}
+static struct timeval gc_start_time, gc_end_time;
+#define PERIOD(t) period(&(t))
+#define LAP(t1, t2) laptime(&(t1), &(t2))
+#else
+static time_t gc_start_time, gc_end_time;
+#define PERIOD(t) time(&(t))
+#define LAP(t1, t2) difftime(t1, t2)
+#endif
+
static void
gc_sweep()
@@ -881,4 +907,5 @@ gc_sweep()
int i, j;
unsigned long live = 0, garbage = 0;
+ double gc, work;
if (ruby_in_compile && ruby_parser_stack_on_heap()) {
@@ -911,4 +938,5 @@ gc_sweep()
if (p->as.basic.flags) {
obj_free((VALUE)p);
+ garbage++;
}
if (need_call_final && FL_TEST(p, FL_FINALIZE)) {
@@ -916,4 +944,5 @@ gc_sweep()
p->as.free.next = final_list;
final_list = p;
+ garbage++;
}
else {
@@ -947,6 +976,12 @@ gc_sweep()
}
}
- malloc_limit += malloc_increase;
- malloc_limit *= (double)live / (live + freed);
+
+ work = LAP(gc_start_time, gc_end_time);
+ PERIOD(gc_end_time);
+ gc = LAP(gc_end_time, gc_start_time);
+ if (work < gc * 2)
+ malloc_limit += GC_MALLOC_LIMIT;
+ else if (live < garbage * 2)
+ malloc_limit /= 2;
if (malloc_limit < GC_MALLOC_LIMIT) malloc_limit = GC_MALLOC_LIMIT;
malloc_increase = 0;
@@ -1132,4 +1167,5 @@ rb_gc_mark_frame(frame)
mark_locations_array(frame->argv, frame->argc);
rb_gc_mark(frame->cbase);
+ rb_gc_mark((VALUE)frame->node);
}
@@ -1189,4 +1225,6 @@ rb_gc()
if (during_gc) return;
during_gc++;
+
+ PERIOD(gc_start_time);
init_mark_stack();
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦