summaryrefslogtreecommitdiffstats
path: root/src/tokenizer.go
AgeCommit message (Collapse)Author
2024-05-07Refactor the code to remove global variablesJunegunn Choi
2024-04-02Further performance improvements by removing unnecessary copiesJunegunn Choi
2022-07-21Fix delimiter regex to properly support caret (^)Junegunn Choi
Fix #2861
2021-01-15Fix typos in source code (#2322)freddii
2019-07-19Code cleanup (#1640)Christian Muehlhaeuser
- Replaced time.Now().Sub() with time.Since() - Replaced unnecessary string/byte slice conversions - Removed obsolete return and value assignment in range loop
2018-03-13Make fzf pass go vetRyan Boehning
Add String() methods to types, so they can be printed with %s. Change some %s format specifiers to %v, when the default string representation is good enough. In Go 1.10, `go test` triggers a parallel `go vet`. So this also makes fzf pass `go test`. Close #1236 Close #1219
2017-08-26Minor refactoringsJunegunn Choi
2017-07-20Avoid unconditionally storsing input as runesJunegunn Choi
When --with-nth is used, fzf used to preprocess each line and store the result as rune array, which was wasteful if the line only contains ascii characters.
2017-06-02Fix inconsistent tiebreak scores when --nth is usedJunegunn Choi
Make sure to consistently calculate tiebreak scores based on the original line. This change may not be preferable if you filter aligned tabular input on a subset of columns using --nth. However, if we calculate length tiebreak only on the matched components instead of the entire line, the result can be very confusing when multiple --nth components are specified, so let's keep it simple and consistent. Close #926
2016-08-19Micro-optimizationsJunegunn Choi
- Make structs smaller - Introduce Result struct and use it to represent matched items instead of reusing Item struct for that purpose - Avoid unnecessary memory allocation - Avoid growing slice from the initial capacity - Code cleanup
2016-08-18Remove duplicate codeJunegunn Choi
2016-08-14[perf] Remove memory copy when using string delimiterJunegunn Choi
2016-08-14[perf] Optimize AWK-style tokenizer for --nthJunegunn Choi
Approx. 50% less memory footprint and 40% improvement in query time
2016-08-14[perf] Avoid allocating rune array for ascii stringJunegunn Choi
In the best case (all ascii), this reduces the memory footprint by 60% and the response time by 15% to 20%. In the worst case (every line has non-ascii characters), 3 to 4% overhead is observed.
2015-10-02Use trimmed length when --nth is used with --tiebreak=lengthJunegunn Choi
This change improves sort ordering for aligned tabular input. Given the following input: apple juice 100 apple pie 200 fzf --nth=2 will now prefer the one with pie. Before this change fzf compared "juice " and "pie ", both of which have the same length.
2015-08-11Fix --with-nth performance; use simpler regular expressionJunegunn Choi
Related #317
2015-08-10Fix --with-nth performance; avoid regex if possibleJunegunn Choi
Close #317
2015-08-02Performance tuning - eager rune array conversionJunegunn Choi
> wc -l /tmp/list2 2594098 /tmp/list2 > time cat /tmp/list2 | fzf-0.10.1-darwin_amd64 -fqwerty > /dev/null real 0m5.418s user 0m10.990s sys 0m1.302s > time cat /tmp/list2 | fzf-head -fqwerty > /dev/null real 0m4.862s user 0m6.619s sys 0m0.982s
2015-04-17Improvements in performance and memory usageJunegunn Choi
I profiled fzf and it turned out that it was spending significant amount of time repeatedly converting character arrays into Unicode codepoints. This commit greatly improves search performance after the initial scan by memoizing the converted results. This commit also addresses the problem of unbounded memory usage of fzf. fzf is a short-lived process that usually processes small input, so it was implemented to cache the intermediate results very aggressively with no notion of cache expiration/eviction. I still think a proper implementation of caching scheme is definitely an overkill. Instead this commit introduces limits to the maximum size (or minimum selectivity) of the intermediate results that can be cached.
2015-01-23Nullify --nth option when it's irrelevantJunegunn Choi
2015-01-12Reorganize source codeJunegunn Choi
2015-01-12LintJunegunn Choi
2015-01-09Minor refactoringJunegunn Choi
2015-01-05Fix index out of bounds error during TransformJunegunn Choi
2015-01-04Rewrite fzf in GoJunegunn Choi