From: Jeff King <peff@peff.net>
To: Rostislav Krasny <rostiprodev@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Subject: Re: [PATCH 1/1] compat: modernize and simplify byte swapping functions
Date: Fri, 2 Jan 2026 01:16:27 -0500 [thread overview]
Message-ID: <20260102061626.GA2581074@coredump.intra.peff.net> (raw)
In-Reply-To: <20260102002735.31390-2-rostiprodev@gmail.com>
On Fri, Jan 02, 2026 at 02:27:35AM +0200, Rostislav Krasny wrote:
> Replace manual bit operations with memcpy + network functions for better
> maintainability. Add missing 16-bit network byte order conversion.
This is burying the lede a bit, as they say. I don't know that the
maintainability is much changed, especially as these are not functions
that anybody looks at or touches very often.
But this part might be compelling:
> - Performance improvements (GCC 15.2.1, Clang 21.1.7):
> * on x86-64 with -O0 4.2x faster (GCC), 3.7x faster (Clang)
> * on x86-64 with -O1 4x faster (GCC), identical (Clang)
> * on x86-64 with -O2 identical (GCC), 1.8x faster (Clang)
The -O0 numbers are IMHO not very interesting (and are entirely
expected; you are comparing optimized library memcpy versus unoptimized
assignments). But clang making -O2 faster is quite interesting.
If we are going to do this, I think it would be for the improved
performance. And it would be nice for the commit message to go into
details about what was measured and how. I'll respond elsewhere in the
thread with some more thoughts.
-Peff
next prev parent reply other threads:[~2026-01-02 6:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 0:27 [PATCH 0/1] compat: modernize and simplify byte swapping functions Rostislav Krasny
2026-01-02 0:27 ` [PATCH 1/1] " Rostislav Krasny
2026-01-02 6:16 ` Jeff King [this message]
2026-01-02 17:37 ` Rostislav Krasny
2026-01-11 22:05 ` Rostislav Krasny
2026-01-14 21:14 ` Jeff King
2026-01-02 7:29 ` [PATCH 0/1] " 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=20260102061626.GA2581074@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=rostiprodev@gmail.com \
--cc=sebastian@breakpoint.cc \
/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