lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] [Commented] (SOLR-7110) Optimize JavaBinCodec to minimize string Object creation
Date Sun, 15 Feb 2015 14:04:11 GMT


Yonik Seeley commented on SOLR-7110:

Background for others who don't know how this works, Solr (javabin format) internally avoids
repeating String keys by allowing strings to be specified by number if it's already been seen
in the current message.

But looking at the patch quickly, this isn't about reusing the "external string" across different
messages.  This is simply about avoiding String creation.  Basically, one reads a sequence
of UTF8 bytes off the stream and instead of creating a new String object, we check a cache
may already have a String for those bytes.  This isn't unique to JavaBin either... one could
use the same technique in any of our transports (including HTTP params).

Gut feel is that as written, this will be slower.  The extra work + overhead of our concurrent
LRU cache should swamp any savings.  Has this been benchmarked?

> Optimize JavaBinCodec to minimize string Object creation
> --------------------------------------------------------
>                 Key: SOLR-7110
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>            Priority: Minor
>         Attachments: SOLR-7110.patch
> In JavabinCodec we already optimize on strings creation , if they are repeated in the
same payload. if we use a cache it is possible to avoid string creation across objects as

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message