Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SRb-0008LW-Hh for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Oct 2018 15:55:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g8SRZ-0003su-KM for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Oct 2018 15:55:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SRZ-0003sn-DJ for pgsql-hackers@lists.postgresql.org; Fri, 05 Oct 2018 15:55:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SRV-0000GQ-UX for pgsql-hackers@lists.postgresql.org; Fri, 05 Oct 2018 15:55:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w95FsxcR030727; Fri, 5 Oct 2018 11:54:59 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org, Thomas Munro , Andrew Gierth , Alexander Kuzmenkov Subject: Re: Performance improvements for src/port/snprintf.c In-reply-to: <6797.1538592539@sss.pgh.pa.us> References: <20181003161454.ozeioucsimjg5g6m@alap3.anarazel.de> <27041.1538583733@sss.pgh.pa.us> <20181003163717.oycshpp2hnctvtfj@alap3.anarazel.de> <28321.1538585692@sss.pgh.pa.us> <20181003170043.thdyezozi343dkuc@alap3.anarazel.de> <2132.1538587869@sss.pgh.pa.us> <20181003173639.tncawup2nnkp7vbv@alap3.anarazel.de> <2435.1538588403@sss.pgh.pa.us> <20181003174513.wxjxfj7eepytnlqa@alap3.anarazel.de> <3316.1538589695@sss.pgh.pa.us> <20181003183552.xaams6fau3i7oybj@alap3.anarazel.de> <6797.1538592539@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 03 Oct 2018 14:48:59 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30725.1538754899.1@sss.pgh.pa.us> Date: Fri, 05 Oct 2018 11:54:59 -0400 Message-ID: <30726.1538754899@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > [ let's use strfromd ] So I'm having second thoughts about this, based on the fact that strfromd() in't strictly a glibc-ism but is defined in an ISO/IEC standard. That means that we can expect to see it start showing up on other platforms (though a quick search did not find any evidence that it has yet). And that means that we'd better consider quality-of-implementation issues. We know that glibc's version is fractionally faster than using sprintf with "%.*g", but what are the odds that that will be true universally? I don't have a warm feeling about it, given that strfromd's API isn't a very good impedance match to what we really need. I really think that what we ought to do is apply the float[48]out hack I showed in <30551.1538517271@sss.pgh.pa.us> and call it good, at least till such time as somebody wants to propose a full-on reimplementation of float output. I don't want to buy back into having platform dependencies in this area after having just expended a lot of sweat to get rid of them. regards, tom lane