All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Collin Funk <collin.funk1@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] groups: Use bsearch instead of hand rolled implementation
Date: Mon, 26 May 2025 01:25:19 +0100	[thread overview]
Message-ID: <20250526002519.GX2023217@ZenIV> (raw)
In-Reply-To: <ab5708c1e35e1b2a54a1d83fafda1b3f8fa01103.1748218528.git.collin.funk1@gmail.com>

On Sun, May 25, 2025 at 05:17:46PM -0700, Collin Funk wrote:
> This code predates <linux/bsearch.h>. Now that the bsearch function
> exists there we can use it to reduce code duplication.

Careful - that really needs profiling with setups where processes have
a bunch of supplementary groups.

It *is* on hot paths, and while the current version will be inlined,
yours will do a bunch of indirect calls.  These days that can be
costly.

Reducing code duplication is a good thing, but not when it creates
measurable regressions...

  reply	other threads:[~2025-05-26  0:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26  0:17 [PATCH] groups: Use bsearch instead of hand rolled implementation Collin Funk
2025-05-26  0:25 ` Al Viro [this message]
2025-05-26 17:46   ` Collin Funk

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=20250526002519.GX2023217@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=collin.funk1@gmail.com \
    --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.