- To: "slug" <slug@xxxxxxxxxxx>
- Subject: RE: [SLUG] Tuesday afternoon shell command optimisation party!
- From: "Roger Barnes" <Roger.Barnes@xxxxxxx>
- Date: Tue, 18 Dec 2007 17:05:53 +1100
- Thread-index: AchBPAxAOFV2oGksR72PrcUh5sy4AA==
- Thread-topic: [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