Repository navigation
IIS: keep the first #Fields: header when the last line parses with it - #6
Merged
Merged
Conversation
Startup read every byte of a big log searching backwards for a header, Apache logs included. Now the first header is checked against the last line and the backward search runs only for a file whose fields changed (and stops at the change); a file with no header in its first 64 KB is not searched. 1 GB IIS log: 0.2 MB read at startup instead of the whole file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Startup used to read every byte of a big log, Apache logs included. It was searching backwards for an IIS header, and the search only stopped when it found one, so a file with a single header at the top, or none at all, was read in full.
Now:
#Fields:header is read from the file's first 64 KB.#Fields:in its first 64 KB is not W3C, and is not searched at all.Measured on 1 GB logs, with startup reads from
/proc/<pid>/io:Known limit: if the fields changed to another set with the same count, and with the address and status in the same columns, the check would still pass. IIS fields come from one fixed list, so that would take a deliberate reshuffle.
Unit tests: 150 checks, 0 failed. The four new checks cover the first header still in effect, fields changed mid-file, a file ending in a header block, and a non-W3C log.
Generated by Claude Code