From owner-dev-commits-src-main@freebsd.org Tue Apr 27 07:05:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC392622F3F; Tue, 27 Apr 2021 07:05:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTt8Q60D9z3Ljq; Tue, 27 Apr 2021 07:05:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id A6F9528E0E; Tue, 27 Apr 2021 07:05:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 88F784CF44; Tue, 27 Apr 2021 09:05:57 +0200 (CEST) Date: Tue, 27 Apr 2021 09:05:57 +0200 From: Baptiste Daroussin To: Ravi Pokala Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) Message-ID: <20210427070557.wv3lkor3tscxzdtg@aniel.nours.eu> References: <202104270309.13R39Lur024105@gitrepo.freebsd.org> <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <705D11CB-3762-4437-8825-8E3040BBAB9F@panasas.com> X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 07:05:58 -0000 On Mon, Apr 26, 2021 at 09:13:53PM -0700, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Baptiste Daroussin > Date: 2021-04-26, Monday at 20:09 > To: , , > Subject: git: 0cd4b781a6fa - main - pw(8): use openmemstream instead of sbuf(9) > > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b > > commit 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b > Author: Baptiste Daroussin > AuthorDate: 2021-04-27 03:05:13 +0000 > Commit: Baptiste Daroussin > CommitDate: 2021-04-27 03:09:07 +0000 > > Hi Baptiste, > > pw(8): use openmemstream instead of sbuf(9) > > That's the "what", but what's the "why"? > > Thanks, > You are right about this. Here the why. I have been the one introducing sbug in pw(8) when I rewrote it, but since the beginning while I found this was better than the solution in place I didn't like adding another external lib just for that. Short after I discovered about open_memstream(3) and figured it could fill the same spot here but keeping the dep only on libc. I was puzzled about pushing this change, and the switch to git reminded me about some uncommit patches sitting on my tree and I ended up pushing it. If people have strong opinion I can revert it back. Things that have not been taken in account in the change, but to answer questions asked privately: - I have performed absolutely no performance benchmark, it does not matter here. - The size of the final binary is smaller: - 76k on amd64 for the new version - 77k for the old version Best regards, Bapt