mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
Avoid periodic object allocations in IndexService
This commit wraps a trace logging message in a trace logging level check to prevent allocating an Object array (to hold the logging parameters) and a String (from the interval) when trace logging is not enabled every second (with the default index refresh interval) and every five seconds (with the default translog sync interval) for every open index when trace logging is not enabled.
This commit is contained in:
parent
1926fe5ad5
commit
b4538a5676
@ -688,7 +688,9 @@ public final class IndexService extends AbstractIndexComponent implements IndexC
|
||||
|
||||
private synchronized void onTaskCompletion() {
|
||||
if (mustReschedule()) {
|
||||
indexService.logger.trace("scheduling {} every {}", toString(), interval);
|
||||
if (indexService.logger.isTraceEnabled()) {
|
||||
indexService.logger.trace("scheduling {} every {}", toString(), interval);
|
||||
}
|
||||
this.scheduledFuture = threadPool.schedule(interval, getThreadPool(), BaseAsyncTask.this);
|
||||
} else {
|
||||
indexService.logger.trace("scheduled {} disabled", toString());
|
||||
|
Loading…
x
Reference in New Issue
Block a user