-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0.4
-
Component/s: Public API
-
None
-
Fully Compatible
Loggable currently builds messages eagerly, even if the message won't be emitted because of the logger's level setting. This is particularly bad because `log_inspect` uses `respond_to?` on every operation to be logged, which walks the Ruby module tree, which is slow and bad.
https://github.com/cheald/mongo-ruby-driver/commit/e187ab023d01ec256a3142053e23a12360af8f92
Using the same benchmark as my previous code, this improved my benchmark runtime by a full 10% (12.1 sec -> 10.9 sec).