You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚡️ Speed up method BenchmarkFunctionRemover._is_benchmark_call by 16% in PR #313 (skip-benchmark-instrumentation)
Here’s an optimized version of your program, designed to improve runtime **without** altering the function signatures or output values. The function is quite simple, but we streamline the checks for speed and minimize unnecessary computation by.
- Saving attribute lookups to variables to avoid recalculating them multiple times.
- Reordering `if` checks so that the least expensive checks are performed first.
- Returning early to avoid the cost of forming an unnecessary `bool()` call or evaluating unnecessary conditions.
**Preserved all comments.**
This removes a function call to `bool`, skips unnecessary conditions, and avoids both repeated lookups and unnecessary object creation.
The logic is unchanged; this is strictly faster.
0 commit comments