The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Peter Taraba <peter.schuster.taraba@gmail.com>,
	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: Wed, 05 Aug 2026 08:29:33 -0600	[thread overview]
Message-ID: <875x1or67m.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20260805004745.81449-1-peter.schuster.taraba@gmail.com>

Peter Taraba <peter.schuster.taraba@gmail.com> writes:

> 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 :)

We don't add new code to the kernel for users that are "secrets".  If
you have an intended user for this code, include it with the series,
please.

There is a recursive function in there, which we tend to avoid for the
kernel.  At a minimum, you would need to provide a convincing
explanation of how you prevent it from overrunning the kernel stack.

Until you showed up with this patch, you have never been seen on the
kernel lists; what inspired you to make this change now?  Was this code
created with assistance from large language models?

Thanks,

jon

  reply	other threads:[~2026-08-05 14:29 UTC|newest]

Thread overview: 8+ 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
2026-08-05 14:29     ` Jonathan Corbet [this message]
2026-08-05 15:47       ` Peter Taraba
2026-08-05 16:39         ` Jonathan Corbet
2026-08-05 18:44           ` Peter Taraba
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=875x1or67m.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.schuster.taraba@gmail.com \
    /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