[Bug 298810] Performance issues with sed in base
- In reply to: bugzilla-noreply_a_freebsd.org: "[Bug 298810] Performance issues with sed in base"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 24 Sep 2026 14:55:47 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298810
Tim Chase <freebsd@tim.thechases.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |freebsd@tim.thechases.com
--- Comment #1 from Tim Chase <freebsd@tim.thechases.com> ---
For the record, this data appears to be "combined log format"
https://httpd.apache.org/docs/2.4/logs.html#combined
rather than "common log format"
https://httpd.apache.org/docs/2.4/logs.html#common
and the sed statement emits all the user-agent strings (the contents of the
last quoted field).
I snagged some publicly-available "combined log format" data from
https://github.com/elastic/examples/blob/master/Common%20Data%20Formats/apache_logs/apache_logs
(beware line 8899 has an unterminated quote that needs to be added in) and can
confirm the long runtime (that data took ~27s here).
If I change the sed invocation to
sed 's/"$//;s/.*"//'
it runs in a tiny fraction of the time (0.825s here).
This has the strong feeling of a backtracking issue, FWIW.
--
You are receiving this mail because:
You are the assignee for the bug.