# Performance degredation between 0.90.5 and 1.4.1

**URL:** <https://discuss.elastic.co/t/performance-degredation-between-0-90-5-and-1-4-1/21633>\
**Category:** Elasticsearch\
**Created:** [January 14, 2015, 10:10am UTC](https://discuss.elastic.co/t/performance-degredation-between-0-90-5-and-1-4-1/21633 "2015-01-14T10:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meidan](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Meidan](https://discuss.elastic.co/u/Meidan)\
**Post date:** [January 14, 2015, 10:10am UTC](https://discuss.elastic.co/t/performance-degredation-between-0-90-5-and-1-4-1/21633/1 "2015-01-14T10:10:51Z")

</div>

Hi,

We're in the process of upgrading from 0.90.5 to 1.4.1 and we see a  
significant performance depredation in one of our queries.  
A short profiling session shows that the biggest difference is in the  
"nested native script" part of the query (see attached), which accounted  
for about 10% of the total search time in 0.90.5, but now it accounts for  
almost 50% in 1.4.1.  
Most of that time is spent in  
org.elasticsearch.search.lookup.DocLookup.get(Object), which in turn calls  
a lot to  
org.elasticsearch.index.fielddata.ordinals.SinglePackedOrdinals$Docs.getOrd(int)  
and the script looks something like this:

```
private Map<String, Double> multipliers;
public float runAsFloat() {
    ScriptDocValues.Strings term = (ScriptDocValues.Strings)doc().get("nested 

```

document term");  
ScriptDocValues.Doubles strength = (ScriptDocValues.Doubles) doc().  
get("nested document term strength");

```
    double score = multipliers.get(term.getValue()) * (1 + strength.

```

getValue());  
return (float)score;  
}

Any idea on what changed between 0.90.5 and 1.4.1 that could have caused  
this?  
Is there a better way of doing DocLookup that I'm missing?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/847a79a0-05a5-450c-a4c4-39ceb49cf0e3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/847a79a0-05a5-450c-a4c4-39ceb49cf0e3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 15, 2015, 2:53am UTC](https://discuss.elastic.co/t/performance-degredation-between-0-90-5-and-1-4-1/21633/2 "2015-01-15T02:53:08Z")

</div>

This might be better raised as an issue on github as one of the devs can  
comment directly on the code you're interested in.

On 14 January 2015 at 23:10, Meidan [meidan.alon@gmail.com](mailto:meidan.alon@gmail.com) wrote:

> Hi,
> 
> We're in the process of upgrading from 0.90.5 to 1.4.1 and we see a  
> significant performance depredation in one of our queries.  
> A short profiling session shows that the biggest difference is in the  
> "nested native script" part of the query (see attached), which accounted  
> for about 10% of the total search time in 0.90.5, but now it accounts for  
> almost 50% in 1.4.1.  
> Most of that time is spent in  
> org.elasticsearch.search.lookup.DocLookup.get(Object), which in turn calls  
> a lot to  
> org.elasticsearch.index.fielddata.ordinals.SinglePackedOrdinals$Docs.getOrd(int)  
> and the script looks something like this:
> 
> ```
> private Map<String, Double> multipliers;
> public float runAsFloat() {
> ScriptDocValues.Strings term = (ScriptDocValues.Strings)doc().get("nested
> 
> ```
> 
> document term");  
> ScriptDocValues.Doubles strength = (ScriptDocValues.Doubles) doc  
> ().get("nested document term strength");
> 
> ```
> double score = multipliers.get(term.getValue()) * (1 + strength.
> 
> ```
> 
> getValue());  
> return (float)score;  
> }
> 
> Any idea on what changed between 0.90.5 and 1.4.1 that could have caused  
> this?  
> Is there a better way of doing DocLookup that I'm missing?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/847a79a0-05a5-450c-a4c4-39ceb49cf0e3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/847a79a0-05a5-450c-a4c4-39ceb49cf0e3%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/847a79a0-05a5-450c-a4c4-39ceb49cf0e3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/847a79a0-05a5-450c-a4c4-39ceb49cf0e3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8ifx%3D6NVKOdqj5s\_8ofD3G86SNgFORH3P9f0LzurKaVw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8ifx%3D6NVKOdqj5s_8ofD3G86SNgFORH3P9f0LzurKaVw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:38am UTC](https://discuss.elastic.co/t/performance-degredation-between-0-90-5-and-1-4-1/21633/3 "2017-07-06T00:38:49Z")

</div>

Closed on July 6, 2017, 12:38am UTC


