[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] [PATCH] setup: Optimize the generation of the series fil
From: |
Andreas Grünbacher |
Subject: |
Re: [Quilt-dev] [PATCH] setup: Optimize the generation of the series file |
Date: |
Thu, 6 Mar 2014 14:25:40 +0100 |
Jean,
2014-03-06 13:41 GMT+01:00 Jean Delvare <address@hidden>:
> 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.
if you're *really* worried about the speed of this loop, a cleaner
approach would
be to remember all the patches in an array, e.g.,
declare -a patches
while read tag dir arg1 arg2
do
[...]
set -- "$arg1" $arg2
address@hidden"$*"
[...]
done < $tmpfile
if [ address@hidden -gt 0 ]
then
[...]
( echo ...
printf "%s\n" "address@hidden"
) > "$prefix$dir/$QUILT_SERIES"
fi
Andreas