All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Taraba <peter.schuster.taraba@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, peter.schuster.taraba@gmail.com
Subject: Re: [PATCH] lib: add statsort(), a distribution/bucket sort
Date: Tue,  4 Aug 2026 17:47:45 -0700	[thread overview]
Message-ID: <20260805004745.81449-1-peter.schuster.taraba@gmail.com> (raw)
In-Reply-To: <20260804173557.782c7ed2242a19ca831c62f1@linux-foundation.org>

here are again benchamrks for large arrays:

== n = 100000000  distribution = uniform      ==
  statsort_longs   best of 1:   9.0722 s  (  90.72 ns/elem)
  sort (kernel)    best of 1: 171.2293 s  (1712.29 ns/elem)
  qsort (libc)     best of 1:  18.4959 s  ( 184.96 ns/elem)

== n = 100000000  distribution = gaussian     ==
  statsort_longs   best of 1:   8.6535 s  (  86.54 ns/elem)
  sort (kernel)    best of 1: 170.0339 s  (1700.34 ns/elem)
  qsort (libc)     best of 1:  17.1339 s  ( 171.34 ns/elem)

Faster than qsort (~twice faster) and way faster than qsort(~19 times faster) for both uniform and gaussian distribution.

I only tested with other c file, which I have not included in this patch. Would you like me to add tests? I can easily do so.

As far as usage, just open your mind... I can't tell all my secrets, because I don't want Microsoft to steal them and pretend it was their idea :)

  reply	other threads:[~2026-08-05  0:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMKTnsb-PZ7_4Zd1ZAtmSWnTk8vyoP07WZUDsLuZ21j7OawQ9g@mail.gmail.com>
2026-08-05  0:35 ` [PATCH] lib: add statsort(), a distribution/bucket sort Andrew Morton
2026-08-05  0:47   ` Peter Taraba [this message]
2026-08-05 14:29     ` Jonathan Corbet
2026-08-05 15:47       ` Peter Taraba
2026-08-05 16:39         ` Jonathan Corbet
2026-08-05 18:44           ` Peter Taraba
2026-08-10 10:22             ` Kuan-Wei Chiu
2026-08-10 13:24               ` Peter Taraba
2026-08-10 15:09                 ` Bradley Morgan
2026-08-10 15:59                   ` Peter Taraba
2026-08-10 16:07                     ` Bradley Morgan
2026-08-04 23:34 Peter Taraba
2026-08-04 23:58 ` Andrew Morton

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=20260805004745.81449-1-peter.schuster.taraba@gmail.com \
    --to=peter.schuster.taraba@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.