Project

General

Profile

« Previous | Next » 

Revision e49db0f7

Added by fablestales (Fable Tales) almost 3 years ago

Do not clone method entries when bind_call is used

I noticed that this site unconditionally clones the method entry, which
means that bind_call always allocates a T_IMEMO. While this clone
is necessary for bind, it is not necessary for bind_call.

I work at Stripe, and the sorbet_runtime gem uses bind call as part
of it's call validation
so this can save us a lot of allocations.

This patch adds a clone parameter to convert_umethod_to_method_components,
which then controls whether or not we do this cloning. This patch passed
Stripe CI and works in our QA environment. I reviewed it with @tenderlove
to talk about correctness also.