summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Transition complex objects to "too complex" shapeJemma Issroff2022-12-152-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <tenderlove@ruby-lang.org>
* Add variation_count on classesJemma Issroff2022-12-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Count how many "variations" each class creates. A "variation" is a a unique ordering of instance variables on a particular class. This can also be thought of as a branch in the shape tree. For example, the following Foo class will have 2 variations: ```ruby class Foo ; end Foo.new.instance_variable_set(:@a, 1) # case 1: creates one variation Foo.new.instance_variable_set(:@b, 1) # case 2: creates another variation foo = Foo.new foo.instance_variable_set(:@a, 1) # does not create a new variation foo.instance_variable_set(:@b, 1) # does not create a new variation (a continuation of the variation in case 1) ``` We will use this number to limit the amount of shapes that a class can create and fallback to using a hash iv lookup. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
* Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams2022-12-151-1/+5
| | | | | | | * Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional.
* socket.rb - simplify check for the methodNobuyoshi Nakada2022-12-151-1/+1
|
* objspace_dump.c: don't dump class of T_IMEMOJean Boussier2022-12-141-1/+5
| | | | They don't actually have a class.
* [ruby/date] Fixed wrong minimum version of RubyHiroshi SHIBATA2022-12-141-1/+1
| | | | | | Fixed https://github.com/ruby/date/issues/83 https://github.com/ruby/date/commit/9731a3e732
* [ruby/syslog] Bump version to 0.1.1Hiroshi SHIBATA2022-12-141-1/+1
| | | | https://github.com/ruby/syslog/commit/a92b55b638
* [ruby/readline-ext] Bump version to 0.1.5Hiroshi SHIBATA2022-12-141-1/+1
| | | | https://github.com/ruby/readline-ext/commit/7af996f24b
* socket.rb - don't load io/wait (#6922)MSP-Greg2022-12-141-1/+1
| | | See d2166c09b08fc1 and #6036 for more context.
* [ruby/date] Implement Date#deconstruct_keys and DateTime#deconstruct_keyszverok2022-12-131-0/+147
| | | | https://github.com/ruby/date/commit/6bb6d3a810
* [ruby/openssl] [DOC] Remove duplicate docNobuyoshi Nakada2022-12-131-6/+3
| | | | | | | RDoc does not consider preprocessor conditionals, but equally uses both documents of `#if` and `#else` sides. https://github.com/ruby/openssl/commit/ea0a112a0c
* We should apply https://github.com/ruby/openssl/pull/576 instead of them:Hiroshi SHIBATA2022-12-131-7/+0
| | | | | https://github.com/ruby/ruby/commit/6d8f396f37350b7aa9c85a097929f54a0939448b https://github.com/ruby/ruby/commit/c8b3bd45cc3cae93ae701333202416838ee6a00c
* [ruby/openssl] Fixes OPENSSL_LIBRARY_VERSION description onHenrique Bontempo2022-12-131-3/+6
| | | | | | documentation (https://github.com/ruby/openssl/pull/559) Adds back missing constant description on the documentation.
* [ruby/openssl] Enable HKDF support for LibreSSL 3.6 and laterTheo Buehler2022-12-131-3/+3
| | | | | | LibreSSL 3.6 added support for HKDF in EVP. Enable this in ossl_kdf.c. https://github.com/ruby/openssl/commit/9bdd39a7e2
* [ruby/openssl] Allow empty string to OpenSSL::Cipher#updateYusuke Nakamura2022-12-131-2/+1
| | | | | | | | For some reasons, plaintext may be empty string. ref https://www.rfc-editor.org/rfc/rfc9001.html#section-5.8 https://github.com/ruby/openssl/commit/953592a29e
* [ruby/openssl] Use EVP_Digest{Sign,Verify} when availableTheo Buehler2022-12-131-2/+2
| | | | | | | | LibreSSL 3.4 added EVP_DigestSign() and EVP_DigestVerify(). Use them when available to prepare for the addition of Ed25519 support in LibreSSL 3.7. https://github.com/ruby/openssl/commit/475b2bf766
* [DOC] Fix format in ObjectSpace.dump_allPeter Zhu2022-12-121-1/+1
|
* [DOC] Fix format for ObjectSpace.dump_shapesPeter Zhu2022-12-121-1/+1
|
* [DOC] Fix call-seq for ObjectSpace methodsPeter Zhu2022-12-121-17/+13
|
* [DOC] Fix typo in docs for ObjectSpace.dump_allPeter Zhu2022-12-121-1/+1
|
* [DOC] Fix indentation for ObjectSpace.dump_allPeter Zhu2022-12-121-32/+32
|
* [DOC] Don't document private methods in objspacePeter Zhu2022-12-121-0/+3
|
* objspace_dump.c: dump the capacity field for INITIAL_CAPACITY shapesJean Boussier2022-12-091-0/+2
| | | | | We forgot about that one, it's quite useful to see which capacity we started from.
* [ruby/date] Bump version to 3.3.1Hiroshi SHIBATA2022-12-091-1/+1
| | | | https://github.com/ruby/date/commit/b7a8229041
* [ruby/date] No-op gem for JRuby for nowCharles Oliver Nutter2022-12-091-8/+15
| | | | | | | | | Remove all shipped files and require path on JRuby until we can add JRuby's extension to the gem. Temporary workaround for #48 https://github.com/ruby/date/commit/94c3becef2
* Merge json-2.6.3Hiroshi SHIBATA2022-12-092-2/+2
|
* Merge stringio-3.0.4Hiroshi SHIBATA2022-12-091-21/+21
|
* Merge fiddle-1.1.1Hiroshi SHIBATA2022-12-092-1/+25
|
* Merge strscan-3.0.5Hiroshi SHIBATA2022-12-093-14/+83
|
* [ruby/etc] Bump version to 1.4.2Hiroshi SHIBATA2022-12-091-1/+1
| | | | https://github.com/ruby/etc/commit/5cac138538
* [ruby/stringio] bump up to 3.0.5Sutou Kouhei2022-12-081-1/+1
| | | | https://github.com/ruby/stringio/commit/e62b9d78d3
* ObjectSpace.dump_all: dump shapes as wellJean Boussier2022-12-083-13/+171
| | | | | | | | | | | | | | | | | | | | | | | | | I see several arguments in doing so. First they use a non trivial amount of memory, so for various memory profiling/mapping tools it is relevant to have visibility of the space occupied by shapes. Then, some pathological code can create a tons of shape, so it is valuable to have a way to have a way to observe shapes without having to compile Ruby with `SHAPE_DEBUG=1`. And additionally it's likely much faster to dump then this way than to use `RubyVM::Shape`. There are however a few open questions: - Shapes can't respect the `since:` argument. Not sure what to do when it is provided. Would probably make sense to not dump them. - Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`? - Maybe instead `dump_all` should take a `shapes: false` argument? Additionally, `ObjectSpace.dump_shapes` is added for the use case of debugging the evolution of the shape tree.
* [ruby/stringio] bump up to 3.0.4Sutou Kouhei2022-12-081-1/+1
| | | | https://github.com/ruby/stringio/commit/5ba853d6ff
* [ruby/psych] Bump version to 5.0.1Hiroshi SHIBATA2022-12-081-1/+1
| | | | https://github.com/ruby/psych/commit/bdf20e6042
* Update dependenciesDaniel Colson2022-12-062-0/+2
|
* Add shape_id to heap dumpJemma Issroff2022-12-051-0/+3
|
* [ruby/bigdecimal] Bump version to 3.1.3Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/bigdecimal/commit/25a75c2033
* [ruby/zlib] Bump version to 3.0.0Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/zlib/commit/f1ce5e3e8d
* [ruby/win32ole] Bump version to 1.8.9Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/win32ole/commit/e4a1f3a2bf
* [ruby/stringio] Revert "Bump version to 3.0.4"Hiroshi SHIBATA2022-12-051-1/+1
| | | | | | This reverts commit https://github.com/ruby/stringio/commit/aeb7e1a0bde6. https://github.com/ruby/stringio/commit/003dd0d003
* [ruby/stringio] Bump version to 3.0.4Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/stringio/commit/aeb7e1a0bd
* [ruby/psych] Bump version to 5.0.0Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/psych/commit/4fed0941b9
* [ruby/pathname] Bump version to 0.2.1Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/pathname/commit/7e796cc78e
* [ruby/nkf] Bump version to 0.1.2Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/nkf/commit/98607bd2be
* [ruby/io-nonblock] Bump version to 0.2.0Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/io-nonblock/commit/46c0ec245e
* [ruby/fcntl] Bump version to 1.0.2Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/fcntl/commit/20fd776303
* [ruby/etc] Bump version to 1.4.1Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/etc/commit/b3e9d9ceb0
* [ruby/digest] Bump version to 3.1.1Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/digest/commit/fad16582ea
* [ruby/date] Bump version to 3.3.0Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/date/commit/ac1642cf39
* [ruby/pathname] [Misc #19155] [DOC] Addion of absolute pathsNobuyoshi Nakada2022-12-031-0/+4
| | | | https://github.com/ruby/pathname/commit/3cb5ed2576