General

Profile

sferik (Erik Berlin)

  • Login: sferik
  • Email: sferik@gmail.com
  • Registered on: 02/28/2011
  • Last sign in: 10/28/2026

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 4 5 9

Activity

10/21/2026

06:56 PM Ruby Revision 4ba4954d (git): Fix Range#include? of an empty range of single characters
A range of single character Strings told that it includes its end
even when it is empty, since the end was not compared with the begin.
("z".."a").to_a #=> []
("z".."a").include?("a") #=> true
(cherry picked from commi...
sferik (Erik Berlin)

10/20/2026

07:12 PM Ruby Revision c71329d4 (git): [ruby/io-console] Keep IO#isatty an alias of IO#tty? on JRuby
The C extension defines both tty? and isatty in IO::platform_tty, so
they stay the same method once io/console is loaded. The JRuby
backends' PlatformTty only defined tty?, so after
https://github.com/ruby/io-console/commit/f686b8305 loa...
sferik (Erik Berlin)

10/19/2026

08:33 PM Ruby Feature #22446: Speed up several core methods in Array, Range, String, Integer, Float and Time
The [neighbor](https://github.com/ankane/neighbor) gem is another example, commonly used by Rails apps to store embeddings with pgvector. pgvector's wire format is text, so `Neighbor::Type::Vector#serialize` does `"[#{value.to_a.map(&:to... sferik (Erik Berlin)

10/17/2026

04:21 AM Ruby Revision 26a4d835 (git): Fix Range#include? of an empty range of single characters
A range of single character Strings told that it includes its end
even when it is empty, since the end was not compared with the begin.
("z".."a").to_a #=> []
("z".."a").include?("a") #=> true
(cherry picked from commi...
sferik (Erik Berlin)

10/16/2026

10:14 PM Ruby Feature #22446: Speed up several core methods in Array, Range, String, Integer, Float and Time
> I'll second Jean, we should absolutely not do this. Im also eager to replace dtoa.c, but if we're changing the algorithm (and especially if that changes the output in any cases) we should do it at most once over the next ~5 years.
T...
sferik (Erik Berlin)
06:05 PM Ruby Feature #22446: Speed up several core methods in Array, Range, String, Integer, Float and Time
> This one is interesting because a large part of the complexity of the implementation is caused by the semantic of these methods is that the comparison is done as element == searched_item.
> ...
This comment inspired another optimizati...
sferik (Erik Berlin)
05:24 PM Ruby Feature #22446: Speed up several core methods in Array, Range, String, Integer, Float and Time
> We don't backport performance patches, only bugfixes.
That's what I thought, but you said:
> ...
Anyway, I am happy to help cover the maintenance cost in whatever way I can.
> That's why I've added the question to the next dev meeti...
sferik (Erik Berlin)
02:22 PM Ruby Feature #22446: Speed up several core methods in Array, Range, String, Integer, Float and Time
Thank you for merging [PR #19360](https://github.com/ruby/ruby/pull/19360)!
> It's not that simple though, there's a maintenance cost to all this (e.g. backports), and these algorithm can have subtly different behavior on fringe cases, ...
sferik (Erik Berlin)
06:02 PM Ruby Bug #22432: Range#include? returns true for the end of an empty range of single-character Strings
### Backport PRs
3.3: https://github.com/ruby/ruby/pull/19395
3.4: https://github.com/ruby/ruby/pull/19396
4.0: https://github.com/ruby/ruby/pull/19397
sferik (Erik Berlin)
05:15 PM Ruby Feature #21308: Replacing the Float#to_s (dtoa.c) implementation with a modern algorithm
I've proposed a patch at https://github.com/ruby/ruby/pull/19309. I have added some benchmarks to demonstrate the gains. sferik (Erik Berlin)

Also available in: Atom