automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: dirstamp: use append too instea


From: Mike Frysinger
Subject: [automake-commit] branch master updated: dirstamp: use append too instead of truncate
Date: Thu, 12 Jan 2023 19:10:44 -0500

This is an automated email from the git hooks/post-receive script.

vapier pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=054b02ce444c6c65dc5cfa68e67741ce43e76b1b

The following commit(s) were added to refs/heads/master by this push:
     new 054b02ce4 dirstamp: use append too instead of truncate
054b02ce4 is described below

commit 054b02ce444c6c65dc5cfa68e67741ce43e76b1b
Author: Mike Frysinger <vapier@gentoo.org>
AuthorDate: Wed Jan 11 21:40:04 2023 -0500

    dirstamp: use append too instead of truncate
    
    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 306913279..1c13a3187 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;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]