public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@systemhalted.org>
To: jrmarsha <jrmarsha@mtu.edu>
Cc: libc-help@sourceware.org
Subject: Re: Considering merge optimizations from Timsort in __move_merge_adaptive, __move_merge_adaptive_backward
Date: Tue, 03 Jul 2018 20:04:00 -0000	[thread overview]
Message-ID: <CAE2sS1gGAzOmGD9dxk6B0eeBN4i0nd3oKY+F95iWp9dQLFd_Tw@mail.gmail.com> (raw)
In-Reply-To: <3c1e0790-9e50-f27b-b78d-b9149517b3e6@mtu.edu>

On Tue, Jul 3, 2018 at 12:16 AM, jrmarsha <jrmarsha@mtu.edu> wrote:
> Hello all,
>
> I've been implementing a new version of Timsort in C++ using more standard
> facilities.  One thing I've come across which adds a divide between a larger
> codebase and faster code is the implementation of std::inplace_merge with
> sufficient memory.  This goes to the specific functions
> __move_merge_adaptive, and __move_merge_adaptive_backward.  In particular,
> there is an optimization where each insertion searches for the maximum
> number of elements it can move.  A brief in context explanation is here:
> https://en.wikipedia.org/wiki/Timsort#Individual_merges .  Would such a
> trick have a place in glibc or is the overhead likely too great in the
> general case?

It's possible. We have a tunable framework for changing runtime
parameters like this based on application needs.  The interface only
allows you to make the choice once at startup. So it may not be
sufficient to meet the needs of all users. However some choice in this
area may be better than no choice.

Cheers,
Carlos.

  reply	other threads:[~2018-07-03 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03  4:16 jrmarsha
2018-07-03 20:04 ` Carlos O'Donell [this message]
2018-07-03 20:10   ` jrmarsha
2018-07-03 23:30     ` Carlos O'Donell
2018-07-04 12:08       ` Adhemerval Zanella
2018-07-20  3:48       ` Joshua Marshall
2018-07-23 20:57         ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE2sS1gGAzOmGD9dxk6B0eeBN4i0nd3oKY+F95iWp9dQLFd_Tw@mail.gmail.com \
    --to=carlos@systemhalted.org \
    --cc=jrmarsha@mtu.edu \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).