incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marvin Humphrey (JIRA)" <>
Subject [jira] Updated: (LUCY-49) Context-aware mergesort and quicksort
Date Mon, 14 Sep 2009 21:40:01 GMT


Marvin Humphrey updated LUCY-49:

    Attachment: SortUtils.c

> Context-aware mergesort and quicksort
> -------------------------------------
>                 Key: LUCY-49
>                 URL:
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Blocker
>         Attachments: SortUtils.bp, SortUtils.c
> The only sort routine you can count on the system providing is qsort.  Some
> systems provide a qsort_r which takes a context argument in addition to the
> items being compared, but not all, and the function signature differs on the
> systems that do provide it (with context being either the first or the last
> argument to the comparison function).
> Lucy::Util::SortUtils provides a context-aware quicksort and a context-aware
> mergesort.  The mergesort also exposes merge routines which are optimized for
> use by an external sorter, as they minimize copying.
> The quicksort implementation guards against the classic quicksort worst-case
> behavior with careful pivot selection.  One popular quicksort optimization is
> still TODO: using insertion sort for array slices of 10 or fewer elements.
> Implementing that optimization may be worthwhile, as this quicksort will
> probably be used for the first level of token-sorting at index time.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message