Speed up find-german-comments 26/9226/2
authorJeroen Nijhof <jeroen@nijhof.co.uk>
Thu, 1 May 2014 16:27:38 +0000 (18:27 +0200)
committerMichael Meeks <michael.meeks@collabora.com>
Fri, 2 May 2014 09:13:13 +0000 (09:13 +0000)
commit6efd9725912ae67bafbfe613220d9c09443ea0ba
tree9cfbb9c6e2599f122d8b0aaf5e20937f7607f722
parentf3816179a0b81c7d122006435a1ebf518309c392
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>
bin/find-german-comments
bin/text_cat/text_cat