Re: [PATCH v4 00/34] Printbufs - new data structure for building strings

From: Kent Overstreet
Date: Tue Jun 21 2022 - 04:01:27 EST


On Tue, Jun 21, 2022 at 08:11:49AM +0200, Rasmus Villemoes wrote:
> On 20/06/2022 02.41, Kent Overstreet wrote:
>
> > Rasmus pointed out that -fno-strict-aliasing is going to cause gcc to generate
> > nasty code, and indeed it unfortunately does but according to worst case
> > scenario microbenchmarks it's not a problem for actual performance.
>
> Well, that's not how I interpreted those numbers, but, except if they
> showed an improvement, how much is acceptable is of course always a
> matter of judgment.
>
> However, what's really annoying and somewhat dishonest is that you're
> not including those numbers, nor the methodology, in either the cover
> letter or commit itself.

There's nothing dishonest about it, and I wasn't claiming an improvement; merely
no regressions (some were a 5-10% percent up, some down by around the same
amount, overall it was a wash).

My priority simply isn't microoptimizing everything. I find that programmers who
chase optimizing every loop and are constantly trying to shave instructions
everywhere they can end up with code where the large scale structure is a mess,
and that's where you miss out on the _real_ performance opportunities.

My priority is clean, readable, simple, easy to work on code, because _that_ is
the code that becomes fast in the long run.

Premature optimization really is the root of all evil, and I am _absolutely_
going to try to drive the discussion away from shaving cycles when there's new
APIs to get right and messy refactorings to complete.