GNU bug report logs - #60746
[PATCH] dirstamp: use append too instead of truncate

Previous Next

Package: automake-patches;

Reported by: Mike Frysinger <vapier <at> gentoo.org>

Date: Thu, 12 Jan 2023 03:03:02 UTC

Severity: normal

Tags: patch

Done: Mike Frysinger <vapier <at> gentoo.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60746 in the body.
You can then email your comments to 60746 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to automake-patches <at> gnu.org:
bug#60746; Package automake-patches. (Thu, 12 Jan 2023 03:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Frysinger <vapier <at> gentoo.org>:
New bug report received and forwarded. Copy sent to automake-patches <at> gnu.org. (Thu, 12 Jan 2023 03:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: automake-patches <at> gnu.org
Subject: [PATCH] dirstamp: use append too instead of truncate
Date: Wed, 11 Jan 2023 22:02:11 -0500
We changed the depfiles logic to use >> (append) instead of > (truncate)
due to it being slightly faster & nicer to the disk.  Do the same with
the dirstamp files as we only need the files to exist -- we don't care
about their content, and we never put anything in them ourselves.  If
someone else were to, we clean them up normally with `make clean`.

Simple test case on my Linux 6.1 w/ext4 on SSD:

@: > foo.txt
for (i = 0; i < 1000000; ++i) close(open("foo.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666));
-> 769 msec

@: >>foo.txt
for (i = 0; i < 1000000; ++i) close(open("foo.txt", O_WRONLY|O_CREAT|O_APPEND, 0666));
-> 2 sec
---
 bin/automake.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/automake.in b/bin/automake.in
index 3069132796f1..1c13a3187f46 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -7902,7 +7902,7 @@ sub require_build_directory
 
   $output_rules .= ("$dirstamp:\n"
 		    . "\t\@\$(MKDIR_P) $directory\n"
-		    . "\t\@: > $dirstamp\n");
+		    . "\t\@: >>$dirstamp\n");
 
   return $dirstamp;
 }
-- 
2.39.0





Information forwarded to automake-patches <at> gnu.org:
bug#60746; Package automake-patches. (Thu, 12 Jan 2023 22:51:01 GMT) Full text and rfc822 format available.

Message #8 received at 60746 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org
Cc: 60746 <at> debbugs.gnu.org
Subject: Re: [bug#60746] [PATCH] dirstamp: use append too instead of truncate
Date: Thu, 12 Jan 2023 15:50:13 -0700
    -		    . "\t\@: > $dirstamp\n");
    +		    . "\t\@: >>$dirstamp\n");

No objection from me. Go for it. Thanks. -k




bug closed, send any further explanations to 60746 <at> debbugs.gnu.org and Mike Frysinger <vapier <at> gentoo.org> Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Fri, 13 Jan 2023 04:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Feb 2023 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.