From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#46881: 28.0.50; pdumper dumping causes way too many syscalls Date: Fri, 5 Mar 2021 09:13:49 -0500 Message-ID: <810bd1fb-dc9c-e65b-66cc-09324859569e@dancol.org> References: <83r1kw6b06.fsf@gnu.org> <90e99fc5-280d-63bb-9bc4-3efe89b9f9e2@dancol.org> <83a6riysnv.fsf@gnu.org> <83zgzixcfy.fsf@gnu.org> <83v9a5yfc0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39949"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: 46881@debbugs.gnu.org, eggert@cs.ucla.edu To: Pip Cet , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 05 15:14:56 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIBEF-000AFj-8E for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 15:14:56 +0100 Original-Received: from localhost ([::1]:41680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIBEE-0003rU-3p for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 09:14:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIBDO-0003qS-Sz for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 09:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIBDN-0007so-Ub for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 09:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIBDN-0008Dn-OM for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 09:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Mar 2021 14:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46881 X-GNU-PR-Package: emacs Original-Received: via spool by 46881-submit@debbugs.gnu.org id=B46881.161495363431578 (code B ref 46881); Fri, 05 Mar 2021 14:14:01 +0000 Original-Received: (at 46881) by debbugs.gnu.org; 5 Mar 2021 14:13:54 +0000 Original-Received: from localhost ([127.0.0.1]:33319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIBDG-0008DG-Ce for submit@debbugs.gnu.org; Fri, 05 Mar 2021 09:13:54 -0500 Original-Received: from dancol.org ([96.126.100.184]:49432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIBDE-0008D8-C5 for 46881@debbugs.gnu.org; Fri, 05 Mar 2021 09:13:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zPPgF/7eO2Uj4xyZhkMnlfvQDA2sfcVuI8ZtqjIQlqg=; b=mnVacmzD3CI0dP5qMP1oJ7Twtf zV7Lyk6yDfrvgZa9T9iRCFlb29rQw2068rCTAlkjDcmkYialZOrxU6bCaVisSPQgg0suBiR8tXfaL 4wrm5FWaWB/X0OuPr2/rRbRVMTovtX0Me3zGltCrKpVS38Qn2sVLyK9B1GZjNVphBCVXxvMvR3qED d0H9rVAzkPtaB+S+3DpR6SjYBzF3ceTghdpjGkumsaXoDzpHY24h5qi6RvseThYQ2gtWT7SR788VG EWQWSpFDhH3zAXLy5W79lp0zSZihiVEXbDrUEW8SHaLUw5RLOvFaCnWwT9IRK9242bIiFNXLLSPi4 l0notuZA==; Original-Received: from [97.104.73.87] (port=49570 helo=[192.168.1.148]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lIBDC-0001sT-Jv; Fri, 05 Mar 2021 06:13:50 -0800 In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201546 Archived-At: On 3/5/21 9:02 AM, Pip Cet wrote: > On Fri, Mar 5, 2021 at 1:16 PM Pip Cet wrote: >>> I say let's go with stdio. >> Maybe setbuffer(3) could help us here? I could run some benchmarks for >> that if the idea isn't out of the question. > Actually, calling setbuffer() with a large buffer will make glibc > reread the entire file on every fseek(), rendering the dump so slow I > gave up and interrupted it. > > However, there's open_memstream: that would have the added advantage > of actually making glibc write out the entire file in one go, so it > seems to shave a few extra milliseconds off the build. > > (However however, glibc's memstreams are somewhat broken. I'll file a > bug report if there isn't one already...) > > Still, that way we could use stdio today, leave the buffering to > glibc, and hopefully be able to switch trivially to a "open this file > but keep it in memory" combined memstream/FILE* one day. You could also use fopencookie to make your own stdio stream that does the right thing while still using the stdio abstraction in the part of the code actually doing the writing.