Luke Gruber ae2c6841c4 Don't create CCs for methods we assume are cold
The assumption is that we're usually calling these methods on boot, and they don't
need CCs. CCs scale with the number of classes that use these methods in the app, so
if you have 10k classes and these classes use 3 of these methods on average, then that
saves 30k CC objects.

Methods on Module that are marked cold are:

public, protected, private, module_function, ruby2_keywords, alias_method, undef_method,
remove_method, attr_reader, attr_writer, attr_accessor, include, prepend.

If these methods ever get redefined, they get new method definitions that are not
marked uncacheable (CCs will get created).

In one of our apps (not the largest), we observed this difference after boot:

| method            | before | after | delta       |
|-------------------|-------:|------:|------------:|
| `include`         |   4518 |     2 |       -4516 |
| `alias_method`    |   3921 |     0 |       -3921 |
| `ruby2_keywords`  |   3784 |     0 |       -3784 |
| `private`         |   3519 |     3 |       -3516 |
| `attr_reader`     |   2738 |     0 |       -2738 |
| `attr_accessor`   |   2288 |     0 |       -2288 |
| `prepend`         |    354 |     1 |        -353 |
| `protected`       |    303 |     0 |        -303 |
| `public`          |    302 |     0 |        -302 |
| `undef_method`    |    178 |     0 |        -178 |
| `attr_writer`     |    124 |     0 |        -124 |
| `module_function` |     42 |     0 |         -42 |
| `remove_method`   |     24 |     0 |         -24 |
| **total**         |        |       | **-22,089** |

NOTE: CC tables and ccs (the malloced struct) are still being created, so this only reduces
the CC objects themselves. I will tackle that in a follow-up.
2026-10-27 09:49:20 -04:00
…
…
2026-07-16 09:47:27 +09:00
2026-10-07 09:57:31 +02:00
2026-10-23 18:51:09 +01:00
2026-07-20 08:22:03 +00:00
2026-09-28 07:29:08 +09:00
2026-10-02 07:36:48 +09:00
2026-10-25 19:59:05 +09:00
2026-07-22 12:37:58 +09:00
2026-10-15 08:00:21 +09:00
…
2026-10-26 08:51:10 +09:00
…
2026-10-25 11:07:01 +09:00
2025-04-09 19:13:58 +09:00
2026-10-03 09:00:26 +09:00
2025-05-11 23:32:50 +09:00
2025-05-11 23:32:50 +09:00
…
…
2026-10-21 17:52:28 +09:00
2026-10-16 08:48:20 +09:00
…
…
2026-01-31 17:45:03 -05:00
…
2026-10-25 11:07:17 +09:00
2026-06-09 15:11:05 +09:00
2026-06-16 10:28:33 +02:00
…
2026-10-23 18:51:09 +01:00
2025-06-12 09:30:09 +02:00
2025-08-30 22:41:23 +09:00
2025-01-30 18:19:53 +09:00
2025-12-15 17:28:35 -05:00
2026-07-23 12:08:25 +09:00
2026-10-19 16:07:39 +09:00
2026-10-09 14:00:15 +09:00
2026-01-15 17:20:34 +09:00
2026-10-19 19:54:37 +02:00
2026-07-07 20:59:49 +09:00
2026-10-21 16:48:38 -07:00
2026-10-21 16:48:38 -07:00
2026-10-21 16:29:43 +09:00
2026-10-27 09:54:05 +09:00
…
…
2026-10-09 14:00:15 +09:00
2026-10-09 14:00:15 +09:00
2026-10-09 14:00:15 +09:00
…
2026-10-11 22:40:45 +09:00
2026-10-12 12:45:28 +09:00
…
2026-10-25 19:59:05 +09:00
2025-12-10 10:23:37 +09:00
2026-10-06 10:47:16 +09:00
2026-07-15 13:28:39 +09:00
2026-05-08 11:27:05 -07:00
2026-10-10 01:14:57 -07:00
2026-10-19 16:07:39 +09:00

Actions Status: MinGW Actions Status: Ubuntu Actions Status: Windows Travis Status

日本語

What is Ruby?

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. mix-in, singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, etc.) cf. https://docs.ruby-lang.org/en/master/maintainers_md.html#label-Platform+Maintainers

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

https://www.ruby-lang.org/en/downloads/

You can download release packages and the snapshot of the repository. If you want to download whole versions of Ruby, please visit https://www.ruby-lang.org/en/downloads/releases/.

Download with Git

The mirror of the Ruby source tree can be checked out with the following command:

$ git clone https://github.com/ruby/ruby.git

There are some other branches under development. Try the following command to see the list of branches:

$ git ls-remote https://github.com/ruby/ruby.git

You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source) if you are a committer.

How to build

See Building Ruby

Ruby home page

https://www.ruby-lang.org/

Documentation

Mailing list

There is a mailing list to discuss Ruby. To subscribe to this list, please send the following phrase:

join

in the mail subject (not body) to the address ruby-talk-request@ml.ruby-lang.org.

Copying

See the file COPYING.

Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list or on websites like https://stackoverflow.com.

Bugs should be reported at https://bugs.ruby-lang.org. Read "Reporting Issues" for more information.

Contributing

See "Contributing to Ruby", which includes setup and build instructions.

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

matz@ruby-lang.org

Languages
Ruby 57.2%
C 29.4%
Rust 8%
C++ 2.6%
Yacc 0.9%
Other 1.8%