Issue #20226 has been reported by omerby (Omer Ben Yosef).
----------------------------------------
Bug #20226: Inconsistent Sort results on 3.3.0 compared to previous versions
https://bugs.ruby-lang.org/issues/20226
* Author: omerby (Omer Ben Yosef)
* Status: Open
* Priority: Normal
* ruby -v: 3.3.0
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Try this code block:
```
[-0.9, -0.88, -0.85, -0.83, -0.81, -0.79, -0.77, -0.75, -0.73, -0.71, -0.69, -0.67, -0.65, -0.63, -0.6, -0.58, -0.56, -0.54, -0.52,
-0.5, -0.48, -0.46, -0.44, -0.42, -0.4, -0.38, -0.35, -0.33, -0.31, -0.29, -0.27, -0.25, -0.23, -0.21, -0.19, -0.17, -0.15, -0.13,
-0.1, -0.08, -0.06, -0.04, -0.02, 0.0, 0.02, 0.0, 0.02].sort_by(&:abs)
```
The end result should be the numbers absolute sorted, look at the last 5 numbers of this, the end result of them should be `[0.0, 0.0, -0.02, 0.02, 0.02...]` maintaining the original order, and this behavior is what we see on ruby 3.2.0, however on ruby 3.3.0 the end result will be `[0.0, 0.0, 0.02, 0.02, -0.02...]`
This is also inconsistent, as `[-0.02, 0.0, 0.02, 0.0, 0.02].sort_by(&:abs)` will actually provide the expected result.
Again, the main issue for us is the difference between 3.3.0 and previous versions of ruby.
--
https://bugs.ruby-lang.org/
Issue #20104 has been reported by jeremyevans0 (Jeremy Evans).
----------------------------------------
Bug #20104: Regexp#match returns nil but allocates T_MATCH objects
https://bugs.ruby-lang.org/issues/20104
* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.4.0dev (2023-12-30T03:14:38Z master 8e32c01742) [x86_64-openbsd7.4]
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
----------------------------------------
Between Ruby 3.2 and 3.3, behavior changed so that Regexp#match will allocate a T_MATCH object even when there is no match. Example code:
```ruby
h = {}
GC.start
GC.disable
ObjectSpace.count_objects(h)
matches = h[:T_MATCH] || 0
md = /\A[A-Z]+\Z/.match('1')
ObjectSpace.count_objects(h)
new_matches = h[:T_MATCH] || 0
puts "/\\A[A-Z]+\\Z/.match('1') => #{md.inspect} generates #{new_matches - matches} T_MATCH objects"
```
Result with Ruby 1.9-3.2:
```
/\A[A-Z]+\Z/.match('1') => nil generates 0 T_MATCH objects
```
Results with Ruby 3.3.0 and current master branch:
```
/\A[A-Z]+\Z/.match('1') => nil generates 1 T_MATCH objects
```
This results in a measurable performance decrease for both Sinatra and Roda web applications, as reported at: https://old.reddit.com/r/ruby/comments/18sxtv9/ruby_330_performance_ups_and…
Thanks to GitHub users kiskoza and tagliala for producing a minimal example showing this issue: https://github.com/caxlsx/caxlsx/issues/336
--
https://bugs.ruby-lang.org/