Closed esabol closed 7 years ago
Both are done in upstream. _send
is an internal sub. It was introduced in v2.003_001 in February. Therefore the sub was rewritten with reference to Gearman::Util::send_req
Let me know when the commit makes it here to GitHub, and I'll take a look. Thanks!
Ah, that's what you meant by upstream. Those changes all look good to me!
I'm not sure if the Perl compiler already optimizes these these things or not, but I suspect not. The following simple optimizations could be made:
Replace
with
A simple change that should improve efficiency.
_send() is a little different though. The second argument is a SCALAR, but Gearman::Util::send_req() wants a REF.
Passing a REF is more efficient, especially with very large requests.
Two possible solutions:
a. Modify Gearman::Util::send_req() to work with the second argument being either a REF or a SCALAR. Then, replace "sub _send { ...}" with
Then, change all the second arguments in the _send() calls to pass the request as a reference.
b. Mark _send() as deprecated (but keep it in case third-party modules or subclasses use it) and change all _send() calls to Gearman::Util::send_req() with the second argument passed as a reference.
What do you think?