Commit graph

12 commits

Author SHA1 Message Date
Daisuke Maki 4b1dfa1c4d fix: fast-path StripANSISequence to skip regexp when no ESC byte
Benchmark (10k lines):
  plain text: 1023us -> 37us (-96%), 1.7MiB -> 0B (-100%), 30k -> 0 allocs
  95% plain:  1064us -> 162us (-85%), 1720KiB -> 63KiB (-96%), 30.5k -> 2k allocs
2026-02-22 00:26:02 +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
Daisuke Maki fc18c0d3de Methodically add function comments 2026-02-20 10:55:49 +09:00
Daisuke Maki 91339e96f9 Do away with pkg/errors 2026-02-16 22:06:21 +09:00
Daisuke Maki db63d9f380 Add linting fixes 2026-02-14 07:48:23 +09:00
Daisuke Maki c7f40e4346 surpress error message when user canceled 2017-02-10 07:06:34 +09:00
Daisuke Maki 45398301ea Apply mattn's review 2016-12-13 10:06:12 +09:00
Daisuke Maki 668a498ed8 slight refactor 2016-12-13 07:21:51 +09:00
Daisuke Maki d8e5bcb349 Move handling collecting results out of the context
This avoids possibly running a race condition during doFinish,
as doFinish onyl notifies that we're exiting now. Collecting the
data is now handled in the main function, after all of the
sub-goroutines are done.

fixes #321 (but only for peco > 0.3.6)
2016-07-01 13:19:02 +09:00
Daisuke Maki 8d89338eb2 Fix Ignorable error detection/test 2016-06-23 02:24:29 -04:00
Daisuke Maki bf161fb19a Make it possible to swap a buffer instead of os.Stdout 2016-06-18 17:40:33 +09:00
Daisuke Maki 586c36a0e7 Let us being the great refactor
* Move internal stuff to internal
* Properly use conditional compilation to detect Windows
* Move type declarations to one location (except for a few places still)
2015-09-28 21:39:43 +09:00