summaryrefslogtreecommitdiffstats
path: root/src/pattern_test.go
AgeCommit message (Collapse)Author
2017-08-20Pass util.Chars by pointerJunegunn Choi
2017-08-15Remove special nilItemJunegunn Choi
2017-08-11Treat | as proper query when it can't be an OR operatorJunegunn Choi
2017-08-10Treat $ as proper search queryJunegunn Choi
When $ is the leading character in a query, it's probably not meant to be an anchor.
2017-08-09Allow escaping meta characters with backslashesJunegunn Choi
One can escape meta characters in extended-search mode with backslashes. Prefixes: \' \! \^ Suffix: \$ Term separator: \<SPACE> To keep things simple, we are not going to support escaping of escaped sequences (e.g. \\') for matching them literally. Since this is a breaking change, we will bump the minor version. Close #444
2017-08-08Fix invalid cache lookupsJunegunn Choi
2017-07-21Further reduce unnecessary rune array conversionJunegunn Choi
I was too quick to release 0.16.9, this commit makes --ansi processing even faster.
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-07-16Reduce memory footprint of Item structJunegunn Choi
2017-07-16Remove pointer indirection by changing Chunk definitionJunegunn Choi
2017-02-01Fix caching scheme when --exact is set and '-prefix is usedJunegunn Choi
2017-01-09Normalize pattern string before passing it to Algo functionJunegunn Choi
2017-01-09Add --normalize option to normalize latin script charactersJunegunn Choi
Close #790
2016-10-04Use exact match by default for inverse search termJunegunn Choi
This is a breaking change, but I believe it makes much more sense. It is almost impossible to predict which entries will be filtered out due to a fuzzy inverse term. You can still perform inverse-fuzzy-match by prepending `!'` to the term. | Token | Match type | Description | | -------- | -------------------------- | --------------------------------- | | `sbtrkt` | fuzzy-match | Items that match `sbtrkt` | | `^music` | prefix-exact-match | Items that start with `music` | | `.mp3$` | suffix-exact-match | Items that end with `.mp3` | | `'wild` | exact-match (quoted) | Items that include `wild` | | `!fire` | inverse-exact-match | Items that do not include `fire` | | `!.mp3$` | inverse-suffix-exact-match | Items that do not end with `.mp3` |
2016-09-18Revise ranking algorithmJunegunn Choi
2016-08-20No need to cache the result in filtering mode (--filter)Junegunn Choi
2016-08-20Remove Offset slice from Result structJunegunn Choi
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-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.
2016-04-16Enhanced ranking algorithmJunegunn Choi
Based on the patch by Matt Westcott (@mjwestcott). But with a more conservative approach: - Does not use linearly increasing penalties; It is agreed upon that we should prefer matching characters at the beginnings of the words, but it's not always clear that the relevance is inversely proportional to the distance from the beginning. - The approach here is more conservative in that the bonus is never large enough to override the matchlen, so it can be thought of as the first implicit tiebreak criterion. - One may argue the change breaks the contract of --tiebreak, but the judgement depends on the definition of "tie".
2015-11-09Add OR operatorJunegunn Choi
Close #412
2015-11-03Make --extended defaultJunegunn Choi
Close #400
2015-09-12Fix #344 - Backward scan when `--tiebreak=end`Junegunn Choi
2015-09-12Make it possible to unquote the term in extended-exact modeJunegunn Choi
Close #338
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-06-08Allow ^EqualMatch$Junegunn Choi
2015-04-21Update test caseJunegunn Choi
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-03-01Make --filter non-blocking when --no-sort (#132)Junegunn Choi
When fzf works in filtering mode (--filter) and sorting is disabled (--no-sort), there's no need to block until input is complete. This commit makes fzf print the matches on-the-fly when the following condition is met: --filter FILTER --no-sort [--no-tac --no-sync] or simply: -f FILTER +s This removes unnecessary delay in use cases like the following: fzf -f xxx +s | head -5 However, in this case, fzf processes the input lines sequentially, so it cannot utilize multiple cores, which makes it slightly slower than the previous mode of execution where filtering is done in parallel after the entire input is loaded. If the user is concerned about the performance problem, one can add --sync option to re-enable buffering.
2015-01-12Reorganize source codeJunegunn Choi
2015-01-12LintJunegunn Choi
2015-01-11Fix Transform result cache to speed up subsequent searchesJunegunn Choi
2015-01-11Fix --with-nth option when query is non-emptyJunegunn Choi
2015-01-04Rewrite fzf in GoJunegunn Choi