From: eregontp@... Date: 2019-06-28T10:25:23+00:00 Subject: [ruby-core:93405] [Ruby trunk Feature#15955] UnboundMethod#apply Issue #15955 has been updated by Eregon (Benoit Daloze). Escape analysis might be able to remove the Method allocation of `unbound.bind(recv).call(*args)`. In fact, TruffleRuby does it for such a pattern. So the interesting question for me is whether this should be fixed by the JIT or by a new method. Could you share a benchmark representing your usage? ---------------------------------------- Feature #15955: UnboundMethod#apply https://bugs.ruby-lang.org/issues/15955#change-78947 * Author: nelhage (Nelson Elhage) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- I'd love a way to apply an UnboundMethod to a receiver and list of args without having to first `bind` it. I've ended up using `UnboundMethod`s in some hot paths in my application due to our metaprogramming idioms, and the allocation from `.bind` is comparatively expensive. I'd love `unbound_method.apply(obj, args���)` to be equivalent to `unbound_method.bind(obj).call(args���)` but without allocating the intermediate `Method` -- https://bugs.ruby-lang.org/ Unsubscribe: