[
https://issues.apache.org/jira/browse/SOLR-18157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18066788#comment-18066788
]
ASF subversion and git services commented on SOLR-18157:
--------------------------------------------------------
Commit f8139551160468ad8a8dd47560ca89888135e562 in solr's branch
refs/heads/branch_10x from Pierre Salagnac
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=f8139551160 ]
SOLR-18157: Optimize buffer allocation in JavaBinCodec (#4208)
Implements a smarter allocation strategy using powers of 2 for the internal
buffer of JavaBinCodec.
(cherry picked from commit f3fe28b872aae7a91d2d17d9a94c63e91f643a38)
> Optimize buffer allocation in JavaBinCodec
> ------------------------------------------
>
> Key: SOLR-18157
> URL: https://issues.apache.org/jira/browse/SOLR-18157
> Project: Solr
> Issue Type: Improvement
> Components: SolrJ
> Affects Versions: 9.10, 10.0
> Reporter: Pierre Salagnac
> Assignee: Pierre Salagnac
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> During massive indexing, I noticed GC on client/SolrJ was a top contributor
> in performance bottlenecks.
> A lot of time is spend in method {{JavaBinCodec.writeStr()}}. It seems we
> allocate an internal buffer much too often. For a given indexing batch, each
> time the provided string input is larger than the previous one, we allocate a
> new buffer with the exact same size as the current input.
> If we are very unlucky and each string is one char longer than the previous
> one, we allocate a new buffer for each string!
> We can easily reduce the number of allocations by increasing buffer size
> exponentially.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]