Closed Bug 1427395 Opened 3 years ago Closed 3 years ago
_cache to be constant-folded in Bugzilla .pm
We already declare request_cache() using the constant pragma. We do this because calling an xsub (briefly, a subroutine written in C) is very fast. However, if we call request_cache() as a subroutine (and not as a class method) the perl compiler is able to constant-fold it. This means there is *no* overhead. Over half of all calls to Bugzilla->request_cache() happen inside Bugzilla.pm, so doing s/\$(self|_\[0\])->request_cache/request_cache/ there will result in a nice speed up. (okay, only from 2ms to 600µs). Changing it in other places will require additional work, as modules are not supposed to 'use Bugzilla' and constant folding requires the subroutine to be declared at compile time...
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.