From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46881: 28.0.50; pdumper dumping causes way too many syscalls Date: Fri, 05 Mar 2021 14:06:55 +0200 Message-ID: <83v9a5yfc0.fsf@gnu.org> References: <83r1kw6b06.fsf@gnu.org> <90e99fc5-280d-63bb-9bc4-3efe89b9f9e2@dancol.org> <83a6riysnv.fsf@gnu.org> <83zgzixcfy.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36457"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46881@debbugs.gnu.org, eggert@cs.ucla.edu To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 05 13:08:20 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 1lI9Fj-0009MY-PD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 13:08:19 +0100 Original-Received: from localhost ([::1]:55590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lI9Fi-00055q-PG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 07:08:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lI9FS-00055S-3c for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 07:08:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lI9FR-0000Cj-Rr for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 07:08:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lI9FR-00053x-M4 for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 07:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Mar 2021 12:08: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.161494604919421 (code B ref 46881); Fri, 05 Mar 2021 12:08:01 +0000 Original-Received: (at 46881) by debbugs.gnu.org; 5 Mar 2021 12:07:29 +0000 Original-Received: from localhost ([127.0.0.1]:33068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lI9Ev-00053A-3t for submit@debbugs.gnu.org; Fri, 05 Mar 2021 07:07:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lI9Et-00052z-Ad for 46881@debbugs.gnu.org; Fri, 05 Mar 2021 07:07:27 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35305) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lI9En-0008Le-8j; Fri, 05 Mar 2021 07:07:21 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1570 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lI9Ed-0006Mh-IQ; Fri, 05 Mar 2021 07:07:19 -0500 In-Reply-To: (message from Pip Cet on Fri, 5 Mar 2021 09:54:32 +0000) 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:201525 Archived-At: > From: Pip Cet > Date: Fri, 5 Mar 2021 09:54:32 +0000 > Cc: Daniel Colascione , eggert@cs.ucla.edu, 46881@debbugs.gnu.org > > My patch: > > real 0m1.988s > user 0m1.916s > sys 0m0.073s > > fwrite-based patch: > > real 0m3.576s > user 0m2.571s > sys 0m1.006s 30% slowdown and 1.5 sec absolute time difference doesn't sound bad enough to me to justify a homemade solution. I say let's go with stdio. > > > Also, we're not currently using fseek-and-write anywhere in Emacs. > > > > I don't see why this would be important. > > Because the stream returned by emacs_fopen might not be generally seekable? I don't see how that could happen. > > Since we open the file in > > binary mode, fseek should work correctly even on non-Posix systems. > > I guess I should have used emacs_fopen :-) Yes, of course. Especially as with fopen there are problems with non-ASCII file names on MS-Windows. > By preparing the data in memory and writing it in one go, which > doesn't require any of the major complications of implementing > buffered streams. There are no complications I can see, not in our sources. (And you don't actually write it in one go anyway, see emacs_full_write.) So let's go with the stdio solution, please.