Company
Date Published
Author
Florian Engelhardt
Word count
1047
Language
English
Hacker News points
1

Summary

The Continuous Profiler in PHP has been updated to include exception profiling, which aims to show the hidden costs of exceptions in hot code paths. The feature was implemented to highlight cases where exceptions are being used for flow control, revealing that a service was throwing 495,000 exceptions per 14.2 seconds due to using an incompatible library's comparator method, which throws exceptions when comparing values. This highlights the importance of using the right tools and libraries for the task at hand. The profiler also surfaces cases where exceptions are being thrown unnecessarily, such as configuration mistakes, and provides guidance on how to clean up these extraneous exceptions. Exception profiling is a sampling profiler that collects both uncaught and caught exceptions, providing valuable insights into performance bottlenecks in applications.