You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "David Smiley (Jira)" <ji...@apache.org> on 2024/12/18 21:12:00 UTC

[jira] [Commented] (SOLR-14691) Metrics reporting should avoid creating objects

    [ https://issues.apache.org/jira/browse/SOLR-14691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17906847#comment-17906847 ] 

David Smiley commented on SOLR-14691:
-------------------------------------

This added {{NavigableObject._size()}} which is implemented by iterating all the entries.  Yes it's overridden  in a couple places but it seems awfully trappy to me.  Also it seems no caller actually cares about the size; only an "isEmpty" is needed.  It's hard to tell if the callers only call to avoid expensive setup over nothing to iterate or if there's a semantic difference.  I find the related metrics code hard to follow.

> Metrics reporting should avoid creating objects
> -----------------------------------------------
>
>                 Key: SOLR-14691
>                 URL: https://issues.apache.org/jira/browse/SOLR-14691
>             Project: Solr
>          Issue Type: Improvement
>          Components: metrics
>            Reporter: Andrzej Bialecki
>            Assignee: Andrzej Bialecki
>            Priority: Critical
>             Fix For: 8.7
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> {{MetricUtils}} unnecessarily creates a lot of short-lived objects (maps and lists). This affects GC, especially since metrics are frequently polled by clients. We should refactor it to use {{MapWriter}} as much as possible.
> Alternatively we could provide our wrappers or subclasses of Codahale metrics that implement {{MapWriter}}, then a lot of complexity in {{MetricUtils}} wouldn't be needed at all.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org