dramatically improved performance for large log files by replacing a sed with tac+awk+tac