summaryrefslogtreecommitdiff
path: root/internal/engine/facts.go
Commit message (Collapse)AuthorAgeFilesLines
* a file's name is folded once, not once per name testLukasz Kasprzak3 days1-0/+19
| | | | | | | | | | Folding is the expensive half of a name test on a name with diacritics, and every name test of every rule folded the same name again: on Polish names it was most of the matching work. The per-file facts memoise it, which is where one file's work belongs - the object is per file and per goroutine, so no lock. 4000 Polish names, twelve rules with name tests: 0.33s -> 0.13s
* max-read bounds what a file becomes, not only what is readLukasz Kasprzak3 days1-0/+26
| | | | | | | | | | | | | | | | | | | | | max-read gates on file size before reading, then the text was read whole and decoded: a file that is not valid UTF-8 decodes one byte per code point and doubles, and normalising and folding copy that again per set of options, with GOMAXPROCS files in flight. Twelve 40 MB files reached 3.3 GB - enough to put a laptop into the OOM killer, with no attacker involved, just a few big .log or .csv files. Two bounds. The decoded text is cut to max-read at a rune boundary, so the ceiling means what a reader takes it to mean. And extraction of files at or above 4 MiB is rationed to two at a time, since holding several large texts at once is what multiplies the ceiling; smaller files, which is nearly all of them, are untouched. twelve 40 MB files: peak RSS 3294 MB -> 728 MB, wall 27s -> 46s two thousand small files: 0.05s both ways The wall-clock cost falls entirely on large files needing extraction, and buys a program that finishes instead of being killed.
* the module path is git.labunix.xyz/krinoLukasz Kasprzak3 days1-8/+8
| | | | | | | | | | | So that go install can find it. cgit serves no go-import meta tag, so nginx answers a ?go-get=1 request for /NAME with one pointing at https://git.labunix.xyz/NAME.git; the alternative was carrying a .git suffix through every import line forever. One sed over the imports, both go.mod files, and the dependency gate's whitelist. Nothing else depends on the path. go install works from the next tag, the first release whose go.mod carries it.
* comments that explain the code, not how it was writtenLukasz Kasprzak3 days1-9/+9
| | | | | | | | | | | | | | | | | | About 340 comments cited the development process: task and plan numbers, fix waves, rulings, reviewers, and the author in the third person with a date. None of that exists outside the work itself, so to a reader it pointed at nothing. Each one now states the engineering reason it was standing in front of; where a comment was provenance and nothing else, it is gone. References to docs/design.md and docs/gui-design.md by section stay: both ship with the repository. The design documents lose their amendment diaries - CHANGELOG.md is that record - and the GUI's says plainly that the window has gone further than the document. Only comments changed. Every .go file was parsed and its code printed with comments stripped, before and after: the two hashes are identical across all 175 files.
* gui: name the other copy of a duplicate, and offer to keep this one insteadLukasz Kasprzak3 days1-0/+12
|
* a rule's duplicate check failure shortens the path tooLukasz Kasprzak5 days1-8/+30
|
* (matched) is unknown after an undecided rule, so a catch-all leaves an ↵Lukasz Kasprzak5 days1-6/+9
| | | | unreadable file alone
* duplicate warnings share one formatLukasz Kasprzak5 days1-2/+19
|
* content tests are three-valued: unknown when unreadable or read in partLukasz Kasprzak5 days1-2/+7
|
* plan 10: a format with no text is no match, not unreadableLukasz Kasprzak5 days1-1/+8
|
* plan 9: keyword cache keys on extension, max-read and Unicode tables, trims ↵Lukasz Kasprzak5 days1-1/+1
| | | | removed keywords
* krino: 0.0.5 — keyword cache, t and d in reviewv0.0.5Lukasz Kasprzak6 days1-28/+83
|
* krino: 0.0.3 — the plan as one block per file, wrapped, and -Pv0.0.3Lukasz Kasprzak6 days1-2/+2
| | | | | | | | Each file shows its steps, then the rule and the reason it matched, one field per line; on a terminal every line wraps to its width with continuation lines under their own column, and piped output is never wrapped. Choosing per file shows the same block. -P / --no-pager prints the plan without the pager. A duplicate's original is shown with ~.
* krino: planning — chains, placeholders, conflicts, JSONLukasz Kasprzak8 days1-11/+2
|
* krino: matching — scan, ignore, conditions, extraction, duplicates, ↵Lukasz Kasprzak8 days1-0/+204
explain, dry run