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

Shalin Shekhar Mangar commented on LUCENE-6779:
-----------------------------------------------

In these results, testWriteString3 is the one which uses scratch bytes to 
encode small strings:
{code}
java -server -Xmx2048M -Xms2048M -Dtests.seed=18262 
-Dtests.datagen.path=./data.txt -Dtests.string.minlen=5 
-Dtests.string.maxlen=64 -Dtests.string.num=10000 -jar target/benchmarks.jar 
-wi 5 -i 50 -gc true -f 2 -prof gc ".*GrowableByteArrayDataOutputBenchmark.*"

# Run complete. Total time: 00:08:55

Benchmark                                                                       
           Mode  Cnt        Score       Error   Units
GrowableByteArrayDataOutputBenchmark.testWriteString1                           
          thrpt  100  2915687.179 ±  4981.266   ops/s
GrowableByteArrayDataOutputBenchmark.testWriteString1:·gc.alloc.rate            
          thrpt  100        0.001 ±     0.001  MB/sec
GrowableByteArrayDataOutputBenchmark.testWriteString1:·gc.alloc.rate.norm       
          thrpt  100       ≈ 10⁻⁴                B/op
GrowableByteArrayDataOutputBenchmark.testWriteString1:·gc.count                 
          thrpt  100          ≈ 0              counts
GrowableByteArrayDataOutputBenchmark.testWriteString2                           
          thrpt  100  4216428.245 ±  7822.793   ops/s
GrowableByteArrayDataOutputBenchmark.testWriteString2:·gc.alloc.rate            
          thrpt  100      595.210 ±     1.103  MB/sec
GrowableByteArrayDataOutputBenchmark.testWriteString2:·gc.alloc.rate.norm       
          thrpt  100      148.060 ±     0.001    B/op
GrowableByteArrayDataOutputBenchmark.testWriteString2:·gc.count                 
          thrpt  100        1.000              counts
GrowableByteArrayDataOutputBenchmark.testWriteString2:·gc.time                  
          thrpt  100        2.000                  ms
GrowableByteArrayDataOutputBenchmark.testWriteString3                           
          thrpt  100  4581362.617 ± 11683.766   ops/s
GrowableByteArrayDataOutputBenchmark.testWriteString3:·gc.alloc.rate            
          thrpt  100        0.001 ±     0.001  MB/sec
GrowableByteArrayDataOutputBenchmark.testWriteString3:·gc.alloc.rate.norm       
          thrpt  100       ≈ 10⁻⁴                B/op
GrowableByteArrayDataOutputBenchmark.testWriteString3:·gc.count                 
          thrpt  100          ≈ 0              counts
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault                     
          thrpt  100  4277669.423 ± 19742.963   ops/s
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault:·gc.alloc.rate      
          thrpt  100      603.855 ±     2.787  MB/sec
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault:·gc.alloc.rate.norm 
          thrpt  100      148.060 ±     0.001    B/op
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault:·gc.churn.PS_Eden_Space
       thrpt  100        5.947 ±    20.169  MB/sec
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault:·gc.churn.PS_Eden_Space.norm
  thrpt  100        1.462 ±     4.958    B/op
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault:·gc.count           
          thrpt  100        2.000              counts
GrowableByteArrayDataOutputBenchmark.testWriteStringDefault:·gc.time            
          thrpt  100        3.000                  ms
{code}

> Reduce memory allocated by CompressingStoredFieldsWriter to write large 
> strings
> -------------------------------------------------------------------------------
>
>                 Key: LUCENE-6779
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6779
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/codecs
>            Reporter: Shalin Shekhar Mangar
>         Attachments: LUCENE-6779.patch, LUCENE-6779.patch, LUCENE-6779.patch, 
> LUCENE-6779_alt.patch
>
>
> In SOLR-7927, I am trying to reduce the memory required to index very large 
> documents (between 10 to 100MB) and one of the places which allocate a lot of 
> heap is the UTF8 encoding in CompressingStoredFieldsWriter. The same problem 
> existed in JavaBinCodec and we reduced its memory allocation by falling back 
> to a double pass approach in SOLR-7971 when the utf8 size of the string is 
> greater than 64KB.
> I propose to make the same changes to CompressingStoredFieldsWriter as we 
> made to JavaBinCodec in SOLR-7971.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to