Tugger the SLUGger!SLUG Mailing List Archives

RE: [SLUG] Tuesday afternoon shell command optimisation party!


> Here's a starting point. What's a more optimal way to perform 
> this task? :-)
> 
>   sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m

For starters, remount the partition containing input.txt with the
noatime option and disable trackerd. :)

Then, change the '*' to a '\+' in your regex.  This saved about 30% CPU
time on a 2Mb sample.

- Rog