diff options
author | Jeroen Nijhof <jeroen@nijhof.co.uk> | 2014-05-01 18:27:38 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-05-02 09:13:13 +0000 |
commit | 6efd9725912ae67bafbfe613220d9c09443ea0ba (patch) | |
tree | 9cfbb9c6e2599f122d8b0aaf5e20937f7607f722 /bin/text_cat | |
parent | f3816179a0b81c7d122006435a1ebf518309c392 (diff) |
Speed up find-german-comments
Instead of recreating a text_cat sub-process for every string, start a
single text-cat process (with the -s flag, "per line") and reuse that.
Testing on svl/source shows a speed-up of 7.5 x, down from 45.6s to 6.1s!
To avoid blocking on the pipes set autoflush in text-cat, and use
read_line instead of read on the find-german-comments side.
Change-Id: Ic6c00fc3c1e7cbcbbfff65512bf54ad11f900697
Reviewed-on: https://gerrit.libreoffice.org/9226
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'bin/text_cat')
-rwxr-xr-x | bin/text_cat/text_cat | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/text_cat/text_cat b/bin/text_cat/text_cat index 6c6b0d1d1483..c907f50b96bb 100755 --- a/bin/text_cat/text_cat +++ b/bin/text_cat/text_cat @@ -19,6 +19,8 @@ $opt_f ||= 0; $opt_t ||= 400; $opt_u ||= 1.05; +$| = 1; # auto-flush stdout + sub help { print <<HELP Text Categorization. Typically used to determine the language of a |