# Performance of NativeScripts

**URL:** <https://discuss.elastic.co/t/performance-of-nativescripts/40017>\
**Category:** Elasticsearch\
**Created:** [January 25, 2016, 11:31am UTC](https://discuss.elastic.co/t/performance-of-nativescripts/40017 "2016-01-25T11:31:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dmitriy\_olshanskiy](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@dmitriy\_olshanskiy](https://discuss.elastic.co/u/dmitriy_olshanskiy)\
**Post date:** [February 10, 2016, 12:51pm UTC](https://discuss.elastic.co/t/performance-of-nativescripts/40017/3 "2016-02-10T12:51:30Z")

</div>

Interestingly I observe that performance degradation is noticeable only with scripted sorting, but not with function\_score. Any ideas on what may be the cause? Posted here:

> [@Function\_score script\_score query vs sort script performance](https://discuss.elastic.co/t/function-score-script-score-query-vs-script-sorting-performance/41377):
>
> I've found an order of magnitude difference in performance of queries that use function\_score with script-based score vs queries that use sort with the same script. What could cause this difference ? Does it make sense to stick to creative use of custom\_score for sorting? (I'm using ES 1.7.4) Example queries: { "explain": false, "fields": ["sku"], "from": 0, "query": { "filtered": { "filter": { "bool": { "must": { "term": { …

---

_[View the full topic](https://discuss.elastic.co/t/performance-of-nativescripts/40017)._
