[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH] setup: Optimize the generation of the series file
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH] setup: Optimize the generation of the series file |
Date: |
Thu, 06 Mar 2014 13:41:35 +0100 |
When quilt setup generates a series file, keep it open while we write
to it, and close it only when we're done. For large patch series, it's
much more efficient than individual redirections which open and close
the file again and again.
This change makes the generation of the series file about 10% faster
in my tests, although it's hardly noticeable in practice because most
of the time is spent elsewhere.
---
quilt/setup.in | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- quilt.orig/quilt/setup.in 2014-02-28 18:01:39.017518315 +0100
+++ quilt/quilt/setup.in 2014-02-28 23:24:45.700942788 +0100
@@ -281,6 +281,10 @@ do
else
if ! [ -e "$prefix$dir/$QUILT_SERIES" ]
then
+ # Open the series file for writing
+ exec 4> "$prefix$dir/$QUILT_SERIES"
+ add_exit_handler "exec 4>&-"
+
( echo "# Patch series file for quilt," \
"created by ${0##*/}"
[ -n "$tar_dir" ] \
@@ -289,9 +293,9 @@ do
&& echo "# Source: $tar_file"
echo "# Patchdir: $dir"
echo "#"
- ) > "$prefix$dir/$QUILT_SERIES"
+ ) >&4
fi
- echo "$arg1" $arg2 >> "$prefix$dir/$QUILT_SERIES"
+ echo "$arg1" $arg2 >&4
fi
;;
esac
--
Jean Delvare
SUSE L3 Support
- [Quilt-dev] [PATCH] setup: Optimize the generation of the series file,
Jean Delvare <=