<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/debug_counter.h, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Use real filename instead of `__FILE__`</title>
<updated>2024-06-02T13:12:05+00:00</updated>
<author>
<name>Daisuke Fujimura (fd0)</name>
<email>booleanlabel@gmail.com</email>
</author>
<published>2024-06-02T12:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e1c9e6244b38f43496400863f610e53c36709589'/>
<id>e1c9e6244b38f43496400863f610e53c36709589</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Missing Counters to `rb_debug_counter_type` enum (#8297)</title>
<updated>2023-08-25T22:27:56+00:00</updated>
<author>
<name>Zack Deveau</name>
<email>zack.ref@gmail.com</email>
</author>
<published>2023-08-25T22:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=480aee4363d2bff26dcdd6b9280cf93ec0f1a06b'/>
<id>480aee4363d2bff26dcdd6b9280cf93ec0f1a06b</id>
<content type='text'>
Add missing counters to rb_debug_counter_type enum

On master we have calls to the RB_DEBUG_COUNTER_INC macro
for counters that are not getting defined in the
rb_debug_counter_type enum.

This commit adds those that are missing in order for
compilation to pass with -DUSE_RUBY_DEBUG_LOG.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missing counters to rb_debug_counter_type enum

On master we have calls to the RB_DEBUG_COUNTER_INC macro
for counters that are not getting defined in the
rb_debug_counter_type enum.

This commit adds those that are missing in order for
compilation to pass with -DUSE_RUBY_DEBUG_LOG.</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused references to the transient heap</title>
<updated>2023-07-13T18:48:14+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-07-13T13:47:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=87e1486d31b26749cc2768ca299faed1b7629d57'/>
<id>87e1486d31b26749cc2768ca299faed1b7629d57</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #19730] Remove transient heap</title>
<updated>2023-07-13T13:27:33+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-06-13T20:19:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1e7b67f73370056c7521306b9f037b6cbccf640d'/>
<id>1e7b67f73370056c7521306b9f037b6cbccf640d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor to separate marking and sweeping phases</title>
<updated>2023-02-21T13:05:31+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-02-14T20:50:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d7c1ca48bf7754a23bfe1559422736029b4787a0'/>
<id>d7c1ca48bf7754a23bfe1559422736029b4787a0</id>
<content type='text'>
This commit separates the marking and sweeping phases so that marking
functions do not directly call sweeping functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit separates the marking and sweeping phases so that marking
functions do not directly call sweeping functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor / document instance variable debug counters</title>
<updated>2023-02-15T16:47:26+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2023-02-14T22:41:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ae2340c9d793e00000186a461a37596b09268370'/>
<id>ae2340c9d793e00000186a461a37596b09268370</id>
<content type='text'>
This commit is refactoring and documenting the debug counters related to
instance variables.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit is refactoring and documenting the debug counters related to
instance variables.
</pre>
</div>
</content>
</entry>
<entry>
<title>Transition complex objects to "too complex" shape</title>
<updated>2022-12-15T18:06:04+00:00</updated>
<author>
<name>Jemma Issroff</name>
<email>jemmaissroff@gmail.com</email>
</author>
<published>2022-12-08T22:16:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c1ab6ddc9a6fa228caa5d26b118b54855051279c'/>
<id>c1ab6ddc9a6fa228caa5d26b118b54855051279c</id>
<content type='text'>
When an object becomes "too complex" (in other words it has too many
variations in the shape tree), we transition it to use a "too complex"
shape and use a hash for storing instance variables.

Without this patch, there were rare cases where shape tree growth could
"explode" and cause performance degradation on what would otherwise have
been cached fast paths.

This patch puts a limit on shape tree growth, and gracefully degrades in
the rare case where there could be a factorial growth in the shape tree.

For example:

```ruby
class NG; end

HUGE_NUMBER.times do
  NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1)
end
```

We consider objects to be "too complex" when the object's class has more
than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and
the object introduces a new variation (a new leaf node) associated with
that class.

For example, new variations on instances of the following class would be
considered "too complex" because those instances create more than 8
leaves in the shape tree:

```ruby
class Foo; end
9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) }
```

However, the following class is *not* too complex because it only has
one leaf in the shape tree:

```ruby
class Foo
  def initialize
    @a = @b = @c = @d = @e = @f = @g = @h = @i = nil
  end
end
9.times { Foo.new }
``

This case is rare, so we don't expect this change to impact performance
of most applications, but it needs to be handled.

Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When an object becomes "too complex" (in other words it has too many
variations in the shape tree), we transition it to use a "too complex"
shape and use a hash for storing instance variables.

Without this patch, there were rare cases where shape tree growth could
"explode" and cause performance degradation on what would otherwise have
been cached fast paths.

This patch puts a limit on shape tree growth, and gracefully degrades in
the rare case where there could be a factorial growth in the shape tree.

For example:

```ruby
class NG; end

HUGE_NUMBER.times do
  NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1)
end
```

We consider objects to be "too complex" when the object's class has more
than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and
the object introduces a new variation (a new leaf node) associated with
that class.

For example, new variations on instances of the following class would be
considered "too complex" because those instances create more than 8
leaves in the shape tree:

```ruby
class Foo; end
9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) }
```

However, the following class is *not* too complex because it only has
one leaf in the shape tree:

```ruby
class Foo
  def initialize
    @a = @b = @c = @d = @e = @f = @g = @h = @i = nil
  end
end
9.times { Foo.new }
``

This case is rare, so we don't expect this change to impact performance
of most applications, but it needs to be handled.

Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MJIT: Remove obsoleted MJIT counters</title>
<updated>2022-12-07T07:05:00+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-12-07T07:01:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=57cb4a817916637eaeb4732f56c5aa5b748a4349'/>
<id>57cb4a817916637eaeb4732f56c5aa5b748a4349</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MJIT: Remove an unused argument and unused counters</title>
<updated>2022-12-07T06:19:26+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-12-07T06:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7e20704000177c5863d97bbda7ca3ea160dafdd1'/>
<id>7e20704000177c5863d97bbda7ca3ea160dafdd1</id>
<content type='text'>
I plan to rebuild MJIT metrics later, not using debug counters.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I plan to rebuild MJIT metrics later, not using debug counters.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused debug counters</title>
<updated>2022-11-13T22:00:30+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-13T21:58:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=68e05234848e8cd0dae7ba9f27a17f9220236fba'/>
<id>68e05234848e8cd0dae7ba9f27a17f9220236fba</id>
<content type='text'>
The structure and readability of jit_exec is messed up right now. I'd
like to help the current situation by this for now. I'll resurrect
them when I need it again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The structure and readability of jit_exec is messed up right now. I'd
like to help the current situation by this for now. I'll resurrect
them when I need it again.
</pre>
</div>
</content>
</entry>
</feed>
