From: Hongli Lai <hongli@plan99.net>
To: ruby-core@ruby-lang.org
Subject: Re: Copy-on-write friendly garbage collector
Date: Thu, 20 Mar 2008 21:54:04 +0900 [thread overview]
Message-ID: <47E25E6F.8010801@plan99.net> (raw)
In-Reply-To: <E1JcJMa-0008KY-0n@x61.netlab.jp>
Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: Copy-on-write friendly garbage collector"
> on Thu, 20 Mar 2008 19:59:16 +0900, Hongli Lai <hongli@plan99.net> writes:
>
> |Sorry for mentioning this again, but it has been almost a week since my
> |last patch. I'd really appreciate it if a core committer can comment on it.
>
> It works on my machine. But since it slows down Ruby a bit, we
> haven't decided yet to merge it officially. Do you (or anyone else)
> have something we can use for GC benchmark?
>
> matz.
Hi.
Yes, I use the following tool for benchmarking:
http://pastebin.com/m26839d72
The results are as follows:
- Standard Ruby: 13.600 seconds
- My Ruby: 16.600 seconds
So the copy-on-write friendly GC seems to be about 20% slower. (At
least, on this machine. I've noticed that the percentage can vary wildly
depending on the specific machine. On some machines it only seems to be
about 5% slower.)
However, I've recently submitted a patch which implements pluggable
marking tables. By default, it uses the non-copy-on-write-friendly
implementation (i.e. the same as the old one, which uses mark flags on
the objects directly). So if I remove the "GC.copy_on_write_friendly =
true" line, then the result is as follows:
- My Ruby: 13.394 seconds
So by default, performance is on par with standard Ruby. Only if the
programmer has explicitly set "GC.copy_on_write_friendly = true" will
there be a speed hit.
The standard Ruby version I use is 1.8.6 patchlevel 114. My modified
Ruby is also based on that version. Both Ruby binaries are compiled with
'-g' (i.e. no optimizations).
Finally, I've benchmarked some Ruby on Rails applications. Only 10% of
the total application time seems to be spent on the garbage collector.
So if the garbage collector is 20% slower, then it only results in a 2%
speed reduction in total.
I'd like to know whether my patches are acceptable, now that it's just
as fast as the normal Ruby by default. And if it's not acceptable, I'd
like to know how many % speed hit would be acceptable.
Thanks.
- Hongli Lai
next prev parent reply other threads:[~2008-03-20 12:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-03 9:48 Copy-on-write friendly garbage collector Hongli Lai
2008-03-03 12:38 ` Daniel DeLorme
2008-03-03 13:11 ` Yukihiro Matsumoto
2008-03-04 11:31 ` Gonzalo Garramuño
2008-03-07 12:04 ` Hongli Lai
2008-03-07 15:20 ` Paul Brannan
2008-03-07 16:22 ` Hongli Lai
2008-03-07 18:47 ` Joel VanderWerf
2008-03-08 5:34 ` Daniel DeLorme
2008-03-08 7:50 ` Daniel DeLorme
2008-03-08 10:01 ` Daniel DeLorme
2008-03-08 15:39 ` Yukihiro Matsumoto
2008-03-12 17:23 ` Hongli Lai
2008-03-12 17:38 ` Yukihiro Matsumoto
2008-03-13 0:48 ` Daniel DeLorme
2008-03-13 11:04 ` Hongli Lai
2008-03-15 16:15 ` Hongli Lai
2008-03-13 11:18 ` Hongli Lai
2008-03-14 3:20 ` Hongli Lai
2008-03-14 4:44 ` Daniel DeLorme
2008-03-14 11:25 ` Hongli Lai
2008-03-14 12:01 ` Meinrad Recheis
2008-03-14 15:00 ` Daniel Berger
2008-03-14 15:53 ` Hongli Lai
2008-03-14 17:34 ` Joel VanderWerf
2008-03-20 10:59 ` Hongli Lai
2008-03-20 11:55 ` Yukihiro Matsumoto
2008-03-20 12:54 ` Hongli Lai [this message]
2008-03-20 14:24 ` Yukihiro Matsumoto
2008-03-20 14:45 ` Hongli Lai
2008-03-20 15:28 ` Joel VanderWerf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47E25E6F.8010801@plan99.net \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).