public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: jrmarsha <jrmarsha@mtu.edu>
To: libc-help@sourceware.org
Subject: Considering merge optimizations from Timsort in __move_merge_adaptive, __move_merge_adaptive_backward
Date: Tue, 03 Jul 2018 04:16:00 -0000	[thread overview]
Message-ID: <3c1e0790-9e50-f27b-b78d-b9149517b3e6@mtu.edu> (raw)

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?

             reply	other threads:[~2018-07-03  4:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03  4:16 jrmarsha [this message]
2018-07-03 20:04 ` Carlos O'Donell
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=3c1e0790-9e50-f27b-b78d-b9149517b3e6@mtu.edu \
    --to=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).