Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generational Garbage Collection for mruby #696

Merged
merged 2 commits into from Jan 6, 2013
Merged

Conversation

authorNari
Copy link
Contributor

HAPPY NEW YEAR!

I've impelemented a generational GC mode for mruby.

This patch introduce GC.generational_mode=.
If you set true mruby's collector change to the generational mode.
(its default value is true at this time, so we will usually use the gen mode).

The major GC performs incrementally.
This is a different point from Lua's GC.

I've measured total GC time of normal and gen mode when executes the following code.

# normal or gen mode
# GC.generational_mode = false
a = []
100_000.times do |i|
  a << i.to_s
end

100.times do
  a.each do |i|
    i.dup
  end
end

Result:

normal:  0.65294(sec)
gen mode:  0.31575(sec)

Thanks!

@mauceri
Copy link
Contributor

mauceri commented Jan 6, 2013

HAPPY NEW YEAR too and to everybody !

Le 6 janv. 2013 à 17:53, Narihiro Nakamura notifications@github.com a écrit :

HAPPY NEW YEAR!

I've impelemented a generational GC mode for mruby.

This patch introduce GC.generational_mode=.
If you set true mruby's collector change to the generational mode.
(its default value is true at this time, so we will usually use the gen mode).

The major GC performs incrementally.
This is a different point from Lua's GC.

I've measured total GC time of normal and gen mode when executes the following code.

normal or gen mode

GC.generational_mode = false

a = []
100_000.times do |i|
a << i.to_s
end

100.times do
a.each do |i|
i.dup
end
end
Result:

normal: 0.65294(sec)
gen mode: 0.31575(sec)
Thanks!

You can merge this Pull Request by running

git pull https://github.com/authorNari/mruby gengc
Or view, comment on, or merge it at:

#696

Commit Summary

These places need the write barrier
Add the generational gc
File Changes

M include/mruby.h (3)
M src/gc.c (289)
M src/variable.c (4)
Patch Links:

https://github.com/mruby/mruby/pull/696.patch
https://github.com/mruby/mruby/pull/696.diff

matz added a commit that referenced this pull request Jan 6, 2013
Generational Garbage Collection for mruby
@matz matz merged commit 101b617 into mruby:master Jan 6, 2013
@authorNari authorNari deleted the gengc branch February 13, 2013 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants