Performance: Pointcut expressions
MEDIUM IMPACT
Pointcut expressions affect the runtime performance by determining which methods are intercepted for aspect logic, impacting method call overhead and application responsiveness.
@Pointcut("execution(* com.example.service.UserService.*(..))")
public void specificPointcut() {}@Pointcut("execution(* com.example..*(..))")
public void broadPointcut() {}| Pattern | Method Matches | Advice Calls | CPU Overhead | Verdict |
|---|---|---|---|---|
| Broad pointcut (e.g., com.example..*) | Many methods | Many advice calls | High CPU overhead | [X] Bad |
| Specific pointcut (e.g., com.example.service.UserService.*) | Few methods | Few advice calls | Low CPU overhead | [OK] Good |