Commit graph

72 commits

Author SHA1 Message Date
Daisuke Maki bf8595be01 merge master, resolve bench_test conflicts 2026-02-22 00:31:46 +09:00
Daisuke Maki 6be528ba24 fix: lint issues in matched pool 2026-02-22 00:29:33 +09:00
Daisuke Maki a5c51bcc4b fix: pool Matched structs with sync.Pool to reduce GC pressure
Benchmark (10k lines x 3 cycles):
  pooled vs unpooled: 107KiB vs 562KiB (-81%), 2 vs 10k allocs
  end-to-end filter: 10.71MiB -> 10.14MiB (-5%), 150.6k -> 121.5k allocs (-19%)
2026-02-22 00:26:22 +09:00
Daisuke Maki 4b6baa3751 fix: in-place mergeMatches to avoid per-merge heap allocation
Benchmark (10k lines, overlapping matches):
  47.4ms -> 42.8ms (-10%), 27.3MiB -> 21.3MiB (-22%), 861k -> 471k allocs (-45%)
2026-02-22 00:26:06 +09:00
Daisuke Maki 6ea14d47b9 fix: reuse match/dedup slices across regexp filter loop iterations
Move slice declarations outside loop and reset with [:0] each iteration.

| Metric     | Before  | After   | Delta  |
|------------|---------|---------|--------|
| allocs/op  | 2209    | 1813    | -396   |
| B/op       | 176836  | 147849  | -28987 |
| ns/op      | ~352k   | ~317k   | -10%   |
2026-02-21 22:28:36 +09:00
Daisuke Maki 7588d33015 fix: eliminate closure allocation in fuzzy filter
Replace strings.IndexFunc with closure with direct CaseInsensitiveIndex.

| Metric     | Before  | After   | Delta  |
|------------|---------|---------|--------|
| allocs/op  | 3018    | 2018    | -1000  |
| B/op       | 123016  | 107014  | -16002 |
| ns/op      | ~113k   | ~88k    | -22%   |
2026-02-21 22:25:06 +09:00
lestrrat 35e1681805
Merge pull request #782 from peco/fix-fuzzy-match-alloc
fix: pre-allocate flat backing array for fuzzy match pairs
2026-02-21 22:23:14 +09:00
Daisuke Maki 580e062548 fix: pre-allocate flat backing array for fuzzy match pairs
Use a single backing []int with subslicing instead of per-match allocations.

| Metric     | Before  | After   | Delta  |
|------------|---------|---------|--------|
| allocs/op  | 3018    | 2018    | -1000  |
| B/op       | 123016  | 108616  | -14400 |
2026-02-21 22:20:19 +09:00
Daisuke Maki 8569cbd5bf appease linter 2026-02-21 22:18:04 +09:00
Daisuke Maki 40ac45f94d Add tests for matching over color boundaries (me being paranoid) 2026-02-21 21:30:18 +09:00
Daisuke Maki 8c4db9e026 convert t.Errorf/t.Fatal to testify/require 2026-02-21 07:58:26 +09:00
lestrrat 76f0724099
Merge pull request #764 from peco/fix-named-returns
remove named return values from Compile and MovePage
2026-02-20 22:31:52 +09:00
lestrrat 464fc30b3d
Merge pull request #766 from peco/fix-external-send-error
propagate out.Send error in external filter
2026-02-20 22:31:31 +09:00
lestrrat b5b1f523be
Merge pull request #765 from peco/fix-regexp-submatch
use FindAllStringIndex instead of FindAllStringSubmatchIndex
2026-02-20 22:31:17 +09:00
lestrrat 2914b94aaa
Merge pull request #762 from peco/fix-regexp-shadow
rename shadowed loop variable in regexp filter
2026-02-20 22:30:44 +09:00
Daisuke Maki 5fa4303b52 standardize on time.Since in regexp cache eviction 2026-02-20 22:27:23 +09:00
Daisuke Maki 0354f3071a rename shadowed loop variable in regexp filter 2026-02-20 22:27:20 +09:00
Daisuke Maki e32edbda88 remove named return values from Compile and MovePage 2026-02-20 22:27:01 +09:00
Daisuke Maki 2f20cddcf6 use FindAllStringIndex instead of FindAllStringSubmatchIndex 2026-02-20 22:26:47 +09:00
Daisuke Maki deb12acf59 propagate out.Send error in external filter 2026-02-20 22:26:44 +09:00
lestrrat b00e80a94e
Merge pull request #756 from peco/fix-regexp-cache
use LRU eviction
2026-02-20 21:09:17 +09:00
lestrrat 2b6d042f93
Merge pull request #755 from peco/fix-fuzzy-redundant
use strings.IndexRun/IndexFunc
2026-02-20 21:09:02 +09:00
Daisuke Maki 70975b098e use LRU eviction 2026-02-20 20:57:21 +09:00
Daisuke Maki 5fc35a050e use strings.IndexRun/IndexFunc 2026-02-20 20:56:09 +09:00
Daisuke Maki ed55e27368 propagate cancellation and distinguish EOF from real I/O errors 2026-02-20 20:51:22 +09:00
Daisuke Maki 8a9dfefb3a change applyFn to interface 2026-02-20 14:05:22 +09:00
Daisuke Maki 88b5b7a39c appease linter 2026-02-20 13:42:55 +09:00
Daisuke Maki 1fea5cd5a0 Replace raw closure callbacks with interfaces 2026-02-20 13:35:31 +09:00
Daisuke Maki d8d010eafc run gofmt -w 2026-02-20 10:58:04 +09:00
Daisuke Maki fc18c0d3de Methodically add function comments 2026-02-20 10:55:49 +09:00
Daisuke Maki 8212acecae fix: external filters should not run in parallel 2026-02-19 18:15:01 +09:00
Daisuke Maki 95e13933c2 Do away with interface.go files 2026-02-18 21:12:19 +09:00
Daisuke Maki c60329eca9 Use var declarations for appended-to slices 2026-02-18 15:57:20 +09:00
lestrrat e09776384f
Merge pull request #696 from peco/fix-filter-dedup-cancellation
Extract checkCancelled helper for filter loops
2026-02-18 14:51:40 +09:00
lestrrat 441feb59a9
Merge pull request #698 from peco/fix-assert-to-require
Replace testify/assert with testify/require
2026-02-18 14:49:14 +09:00
lestrrat 6fdcd40b78
Merge pull request #699 from peco/fix-filter-dedup-exclusion
Extract isExcluded helper for negative term check
2026-02-18 14:48:45 +09:00
Daisuke Maki d1e5b18232 Replace testify/assert with testify/require 2026-02-18 14:46:06 +09:00
Daisuke Maki 1e90260188 Extract checkCancelled helper for filter loops 2026-02-18 14:46:05 +09:00
Daisuke Maki 0d55ffa4ae Extract isExcluded helper for negative term check 2026-02-18 14:46:04 +09:00
Daisuke Maki 44b78c5dd8 Extract newRegexpFilter helper for filter constructors 2026-02-18 14:46:03 +09:00
Daisuke Maki 8910d5bf17 remove error, avoid magic string 2026-02-18 09:46:27 +09:00
Daisuke Maki 46331edcfd Check for far wider range of things in lint 2026-02-18 07:49:40 +09:00
Daisuke Maki e61e114ded convert missing context key refactoring 2026-02-17 21:40:04 +09:00
Daisuke Maki aacc46f593 remove unused field 2026-02-17 19:01:41 +09:00
Daisuke Maki 939f75ee85 Remove unused outch 2026-02-17 18:58:18 +09:00
Daisuke Maki 28d7583555 Use saner struct key approach 2026-02-17 13:13:28 +09:00
Daisuke Maki 8f0204320c don't throw away panics in external filters 2026-02-17 07:39:31 +09:00
Daisuke Maki f5f6262d82 use types in pipelines 2026-02-16 23:51:36 +09:00
Daisuke Maki 7f62fe18b3 Refactor filter 2026-02-16 22:43:11 +09:00
lestrrat 2debeb5b28
Merge pull request #611 from peco/remove-pkg-errors
Do away with pkg/errors
2026-02-16 22:09:00 +09:00