Commit Graph

27 Commits (f6aa28c380b5adda251fa9fe33dfb4a2ae721b1f)

Author SHA1 Message Date
Junegunn Choi 4c70745cc1
Fix bug where preview is not updated after reload when --disabled is set
Fix #3311
1 year ago
Junegunn Choi 78da928727
Experimental implementation of "reload" action
# Reload input list with different sources
  seq 10 | fzf --bind 'ctrl-a:reload(seq 100),ctrl-b:reload(seq 1000)'

  # Reload as you type
  seq 10 | fzf --bind 'change:reload:seq {q}' --phony

  # Integration with ripgrep
  RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
  INITIAL_QUERY=""
  FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \
    fzf --bind "change:reload:$RG_PREFIX {q} || true" \
        --ansi --phony --query "$INITIAL_QUERY"

Close #751
Close #965
Close #974
Close #1736
Related #1723
5 years ago
Christian Muehlhaeuser a1260feeed Code cleanup (#1640)
- Replaced time.Now().Sub() with time.Since()
- Replaced unnecessary string/byte slice conversions
- Removed obsolete return and value assignment in range loop
5 years ago
Junegunn Choi 5624a89231
Inverse-only matches should not reorder the remaining results
Fix #1458
6 years ago
Junegunn Choi bbe10f4f77
Consolidate Result and rank structs
By not storing item index twice, we can cut down the size of Result
struct and now it makes more sense to store and pass Results by values.
Benchmarks show no degradation of performance by additional pointer
indirection for looking up index.
7 years ago
Junegunn Choi 2fc7c18747
Revise ranking algorithm 8 years ago
Junegunn Choi 827a83efbc
Remove Offset slice from Result struct 8 years ago
Junegunn Choi 37dc273148
Micro-optimizations
- 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
8 years ago
Junegunn Choi f7f01d109e
Set the upper limit of the number of search go routines 8 years ago
Junegunn Choi babf877fd6
Increase the number of go routines for search
Sort performance increases as the size of each sublist decreases (n in
nlog(n) decreases). Merger is then responsible for merging the sorted
lists in order, and since in most cases we are only interesed in the
matches in the first page on the screen so the overhead in the process
is negligible.
8 years ago
Junegunn Choi d4b6338102
Lint 8 years ago
Sergey Vlasov e3401a0645 Go 1.3 compatibility 8 years ago
Junegunn Choi 634670e3ea Lint 9 years ago
Junegunn Choi 2fe1e28220 Improvements in performance and memory usage
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.
9 years ago
Junegunn Choi 50292adacb Implement --toggle-sort option (#173) 9 years ago
Junegunn Choi b431e227da Code cleanup 9 years ago
Junegunn Choi d94dfe0876 Fix #151 - reduce initial memory footprint 9 years ago
Junegunn Choi c1aa5c5f33 Add --tac option and reverse display order of --no-sort
DISCLAIMER: This is a backward incompatible change
9 years ago
Junegunn Choi f5b034095a Fix race condition in asynchronous -1 and -0 9 years ago
Junegunn Choi e808151c28 Make --select-1 and --exit-0 asynchronous 9 years ago
Junegunn Choi d760b790b3 Fix typo in code 9 years ago
Junegunn Choi cd847affb7 Reorganize source code 10 years ago
Junegunn Choi 7a2bc2cada Lint 10 years ago
Junegunn Choi 9dbf6b02d2 Fix race conditions
- Wait for completions of goroutines when cancelling a search
- Remove shared access to rank field of Item
10 years ago
Junegunn Choi b7bb100810 Improve response time by only looking at top-N items 10 years ago
Junegunn Choi 40d0a6347c Fix scan limit for --select-1 and --exit-0 options 10 years ago
Junegunn Choi f3177305d5 Rewrite fzf in Go 10 years ago