You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Pierre Salagnac (Jira)" <ji...@apache.org> on 2026/03/11 09:49:00 UTC
[jira] [Created] (SOLR-18157) Optimize buffer allocation in JavaBinCodec
Pierre Salagnac created SOLR-18157:
--------------------------------------
Summary: 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: 10.0, 9.10
Environment: 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.
Reporter: Pierre Salagnac
Assignee: Pierre Salagnac
--
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