-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
As part of types removal we discovered that DeprecationLogger.deprecatedAndMaybeLog() calls were the source of a big performance regression.
I suspect the bulk of the performance cost is in the use of the extractWarningValueFromWarningHeader method which has to parse prior logged messages to reject any duplicates.
Since that discovery we have implemented our own upstream event thinning in the bulk indexing API and now search APIs to reduce the number of duplicate deprecation calls.
The remaining concern is that other areas of the system may be tempted to make the same mistake given the logging API advertises a de-duplicate function through the use of a common key. Even if developers are aware of the poor performance they may not have a single loop (like in bulk indexing) where it is convenient to add the required trimming of log calls.
If the DeprecationLogger implementation was made more efficient this would help with all these concerns.