lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4839) Sorter API: Use TimSort to sort doc IDs and postings lists
Date Sat, 16 Mar 2013 14:44:12 GMT


Adrien Grand commented on LUCENE-4839:

One major difference with the original impl is that I reused the merge routine used by mergeSort
instead of porting the original one which has a few optimizations to merge runs which have
different lengths and/or some patterns (look for "galloping" in listsort.txt) but requires
extra memory. This doesn't change the fact that this impl performs extremely well when data
is partially sorted.
> Sorter API: Use TimSort to sort doc IDs and postings lists
> ----------------------------------------------------------
>                 Key: LUCENE-4839
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-4839.patch
> TimSort (, used by python
and Java's Arrays.sort(Object[]) in particular) is a sorting algorithm that performs very
well on partially-sorted data. Indeed, with TimSort, sorting an array which is in reverse
order or a finite concatenation of sorted arrays is a linear operation (instead of O(n ln(n))).
> The sorter API could benefit from this algorithm when using Sorter.REVERSE_DOCS or merging
several sorted readers for example.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

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

View raw message