From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6299 invoked from network); 23 Aug 2020 09:33:48 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 23 Aug 2020 09:33:48 -0000 Received: (qmail 7573 invoked by uid 550); 23 Aug 2020 09:33:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 7552 invoked from network); 23 Aug 2020 09:33:41 -0000 Date: Sun, 23 Aug 2020 12:33:30 +0300 (MSK) From: Alexander Monakov To: musl@lists.openwall.com In-Reply-To: <20200823102439.2bbaffb5@inria.fr> Message-ID: References: <20200823102439.2bbaffb5@inria.fr> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="168458499-694970221-1598175210=:12553" Subject: Re: [musl] direct coding of asctime_r This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --168458499-694970221-1598175210=:12553 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 23 Aug 2020, Jens Gustedt wrote: > Looking into musl I found that the current implementation is basically > doing verbatim what the C standard says, namely uses `snprintf` under > the hood to do the formatting. This has obviously the disadvantage > that this drags the whole infrastructure that is needed for `snprintf` > into the executable. > > Making some tests, I found that coding `asctime_r` straight forward > with byte-copying has it shave off about 10k from the final > executable. Do I understand correctly that this 10k figure is for an "application" that does not use stdio at all otherwise? If so, I believe that is a quite unrealistic test — why would an application use asctime_r but then avoid use of stdio to do something useful with the result? Alexander --168458499-694970221-1598175210=:12553--