git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [DEMO][PATCH v2 6/5] compat: add a qsort_s() implementation based on GNU's qsort_r(1)
Date: Wed, 25 Jan 2017 19:43:01 +0100	[thread overview]
Message-ID: <f41e5053-ee24-060f-0fb9-b257b3ba35a0@web.de> (raw)
In-Reply-To: <20170124203949.46lbmiyj26xx4hrk@sigill.intra.peff.net>

Am 24.01.2017 um 21:39 schrieb Jeff King:
> On Tue, Jan 24, 2017 at 07:00:03PM +0100, René Scharfe wrote:
>
>>> I do worry about having to support more implementations in the
>>> future that have different function signature for the comparison
>>> callbacks, which will make things ugly, but this addition alone
>>> doesn't look too bad to me.
>>
>> It is unfair of me to show a 5% speedup and then recommend to not
>> include it. ;-)  That difference won't be measurable in real use cases
>> and the patch is not necessary.  This patch is simple, but the overall
>> complexity (incl. #ifdefs etc.) will be lower without it.
>
> I care less about squeezing out the last few percent performance and
> more that somebody libc qsort_r() might offer some other improvement.
> For instance, it could sort in-place to lower memory use for some cases,
> or do some clever thing that gives more than a few percent in the real
> world (something like TimSort).
>
> I don't know to what degree we should care about that.

That's a good question.  Which workloads spend a significant amount of 
time in qsort/qsort_s?

We could track processor time spent and memory allocated in QSORT_S and 
the whole program and show a warning at the end if one of the two 
exceeded, say, 5% of the total, asking nicely to send it to our mailing 
list.  Would something like this be useful for other functions or 
metrics as well?  Would it be too impolite to use users as telemetry 
transports?

If we find such cases then we'd better fix them for all platforms, e.g. 
by importing timsort, no?

René

  reply	other threads:[~2017-01-25 18:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22 17:47 [PATCH v2 0/5] string-list: make string_list_sort() reentrant René Scharfe
2017-01-22 17:51 ` [PATCH v2 1/5] compat: add qsort_s() René Scharfe
2017-01-22 17:52 ` [PATCH v2 2/5] add QSORT_S René Scharfe
2017-01-22 17:53 ` [PATCH v2 3/5] perf: add basic sort performance test René Scharfe
2017-01-22 17:57 ` [PATCH v2 4/5] string-list: use QSORT_S in string_list_sort() René Scharfe
2017-01-22 17:58 ` [PATCH v2 5/5] ref-filter: use QSORT_S in ref_array_sort() René Scharfe
2017-01-22 18:02 ` [DEMO][PATCH v2 6/5] compat: add a qsort_s() implementation based on GNU's qsort_r(1) René Scharfe
2017-01-23 19:07   ` Junio C Hamano
2017-01-24 18:00     ` René Scharfe
2017-01-24 20:39       ` Jeff King
2017-01-25 18:43         ` René Scharfe [this message]
2017-01-25 18:51           ` Jeff King
2017-01-26 13:49             ` Johannes Schindelin
2017-01-23 23:54 ` [PATCH v2 0/5] string-list: make string_list_sort() reentrant Jeff King
2017-01-24 11:44   ` Johannes Schindelin
2017-01-24 13:44     ` Jeff King
2017-01-24 18:00   ` René Scharfe
2017-01-24 20:41     ` Jeff King

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=f41e5053-ee24-060f-0fb9-b257b3ba35a0@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    /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 NNTP newsgroup(s).