[#107430] [Ruby master Feature#18566] Merge `io-wait` gem into core IO — "byroot (Jean Boussier)" <noreply@...>

SXNzdWUgIzE4NTY2IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGJ5cm9vdCAoSmVhbiBCb3Vzc2llciku

22 messages 2022/02/02

[#107434] [Ruby master Bug#18567] Depending on default gems when not needed considered harmful — "Eregon (Benoit Daloze)" <noreply@...>

SXNzdWUgIzE4NTY3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IEVyZWdvbiAoQmVub2l0IERhbG96ZSku

31 messages 2022/02/02

[#107443] [Ruby master Feature#18568] Explore lazy RubyGems boot to reduce need for --disable-gems — "headius (Charles Nutter)" <noreply@...>

SXNzdWUgIzE4NTY4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGhlYWRpdXMgKENoYXJsZXMgTnV0dGVy

13 messages 2022/02/02

[#107481] [Ruby master Feature#18571] Removed the bundled sources from release package after Ruby 3.2 — "hsbt (Hiroshi SHIBATA)" <noreply@...>

SXNzdWUgIzE4NTcxIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGhzYnQgKEhpcm9zaGkgU0hJQkFUQSku

9 messages 2022/02/04

[#107490] [Ruby master Bug#18572] Performance regression when invoking refined methods — "palkan (Vladimir Dementyev)" <noreply@...>

SXNzdWUgIzE4NTcyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHBhbGthbiAoVmxhZGltaXIgRGVtZW50

12 messages 2022/02/05

[#107514] [Ruby master Feature#18576] Rename `ASCII-8BIT` encoding to `BINARY` — "byroot (Jean Boussier)" <noreply@...>

SXNzdWUgIzE4NTc2IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGJ5cm9vdCAoSmVhbiBCb3Vzc2llciku

47 messages 2022/02/08

[#107536] [Ruby master Feature#18579] Concatenation of ASCII-8BIT strings shouldn't behave differently depending on string contents — "tenderlovemaking (Aaron Patterson)" <noreply@...>

SXNzdWUgIzE4NTc5IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHRlbmRlcmxvdmVtYWtpbmcgKEFhcm9u

11 messages 2022/02/09

[#107547] [Ruby master Bug#18580] Range#include? inconsistency for String ranges — "zverok (Victor Shepelev)" <noreply@...>

SXNzdWUgIzE4NTgwIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHp2ZXJvayAoVmljdG9yIFNoZXBlbGV2

10 messages 2022/02/10

[#107603] [Ruby master Feature#18589] Finer-grained constant invalidation — "kddeisz (Kevin Newton)" <noreply@...>

SXNzdWUgIzE4NTg5IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtkZGVpc3ogKEtldmluIE5ld3Rvbiku

17 messages 2022/02/16

[#107624] [Ruby master Bug#18590] String#downcase and CAPITAL LETTER I WITH DOT ABOVE — "andrykonchin (Andrew Konchin)" <noreply@...>

SXNzdWUgIzE4NTkwIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGFuZHJ5a29uY2hpbiAoQW5kcmV3IEtv

13 messages 2022/02/17

[#107651] [Ruby master Misc#18591] DevMeeting-2022-03-17 — "mame (Yusuke Endoh)" <noreply@...>

SXNzdWUgIzE4NTkxIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IG1hbWUgKFl1c3VrZSBFbmRvaCkuCgot

11 messages 2022/02/18

[#107682] [Ruby master Feature#18595] Alias `String#-@` as `String#dedup` — "byroot (Jean Boussier)" <noreply@...>

SXNzdWUgIzE4NTk1IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGJ5cm9vdCAoSmVhbiBCb3Vzc2llciku

15 messages 2022/02/21

[#107699] [Ruby master Feature#18597] Strings need a named method like `dup` that doesn't duplicate if receiver is mutable — "danh337 (Dan H)" <noreply@...>

SXNzdWUgIzE4NTk3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGRhbmgzMzcgKERhbiBIKS4KCi0tLS0t

18 messages 2022/02/21

[ruby-core:107407] Re: [Ruby master Feature#16663] Add block or filtered forms of Kernel#caller to allow early bail-out

From: Gregory Cohen <gregorycohen2@...>
Date: 2022-02-01 03:59:31 UTC
List: ruby-core #107407
unsubscribe

On Mon, Jan 31, 2022 at 8:39 PM jeremyevans0 (Jeremy Evans) <
noreply@ruby-lang.org> wrote:

> Issue #16663 has been updated by jeremyevans0 (Jeremy Evans).
>
>
> headius (Charles Nutter) wrote in #note-25:
> > Is there a way to prohibit the `to_enum` form? I don't think it will be
> useful to support since it may vary greatly across implementations
> (depending on what the stack looks like and what gets included).
>
> I don't know of a way to do this.  I don't think the method being called
> can tell whether it is being run via an enumerator or not.  In CRuby, you
> could probably override `to_enum`, check if the method being called is a C
> method using the same C function, and fail in that case, but that's trivial
> to work around be rebinding the Kernel `to_enum` method.
>
> > It does raise a question for me, though... is your patch eagerly
> capturing the stack? I have been trying to figure out how the stack trace
> is identical in both the block form and the to_enum form and it seems like
> the trace would have to have been captured at the same level, rather than
> at the point the enum starts to run.
>
> It isn't identical.  From the tests:
>
> ```ruby
>     cllr = caller_locations(1, 2); ary =
> Thread.to_enum(:each_caller_location).to_a[2..3]
>     assert_equal(cllr.map(&:to_s), ary.map(&:to_s))
> ```
>
> The `[2..3]` shows there are extra entries in the `to_enum` case.
>
> ----------------------------------------
> Feature #16663: Add block or filtered forms of Kernel#caller to allow
> early bail-out
> https://bugs.ruby-lang.org/issues/16663#change-96305
>
> * Author: headius (Charles Nutter)
> * Status: Open
> * Priority: Normal
> ----------------------------------------
> There are many libraries that use `caller` or `caller_locations` to gather
> stack information for logging or instrumentation. These methods generate an
> array of informational stack frames based on the current call stack.
>
> Both methods accept parameters for `level` (skip some number of Ruby
> frames) and `length` (only return this many frames). However many use cases
> are unable to provide one or both of these.
>
> Instrumentation uses, for example, may need to skip an unknown number of
> frames at the top of the trace, such as to dig out of rspec plumbing or
> active_record internals and report the first line of user code. In such
> cases, the typical pattern is to simply request *all* frames and then
> filter out the one that is desired.
>
> This leads to a great deal of wasted work gathering those frames and
> constructing objects to carry them to the user. On optimizing runtimes like
> JRuby and TruffleRuby, it can have a tremendous impact on performance,
> since each frame has a much higher cost than on CRuby.
>
> I propose that we need a new form of `caller` that takes a block for
> processing each element.
>
> ```ruby
> def find_matching_frame(regex)
>   caller do |frame|
>     return frame if frame.file =~ regex
>   end
> end
> ```
>
> An alternative API would be to allow passing a query object as a keyword
> argument, avoiding the block dispatch by performing the match internally:
>
> ```ruby
> def find_matching_frame(regex)
>   caller(file: regex)
> end
> ```
>
> This API would provide a middle ground between explicitly specifying a
> maximum number of stack frames and asking for all frames. Most common,
> hot-path uses of `caller` could be replaced by these forms, reducing
> overhead on all Ruby implementations and drastically reducing it where
> stack traces are expensive.
>
>
>
> --
> https://bugs.ruby-lang.org/
>
> Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
>
ClVuc3Vic2NyaWJlOiA8bWFpbHRvOnJ1YnktY29yZS1yZXF1ZXN0QHJ1YnktbGFuZy5vcmc/c3Vi
amVjdD11bnN1YnNjcmliZT4KPGh0dHA6Ly9saXN0cy5ydWJ5LWxhbmcub3JnL2NnaS1iaW4vbWFp
bG1hbi9vcHRpb25zL3J1YnktY29yZT4K

In This Thread