junegunn / junegunn/fzf

Slow with Arabic (esp vs fzy)

Open
#2,345 5 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

- [x] I have the latest version of fzf
- [x] I have read through the manual page (`man fzf`)
- [x] I have searched through the existing issues

## Info

- OS
- [x] Linux
- [x] Mac OS X
- Shell
- [x] bash

## Problem / Steps to reproduce

I appreciate that this is not a common use case however I have noticed that **fzf** is many times slower than **fzy** when searching Arabic (and fzy's results are quite good).

### Dataset
```bash
wget https://dumps.wikimedia.org/arwiki/latest/arwiki-latest-abstract1.xml.gz
gunzip arwiki-latest-abstract1.xml.gz
```

`fzf`
```
$> time cat arwiki-latest-abstract1.xml | fzf -f 'هذه تجربة' | wc -l
6427
real 0m3.425s
user 0m16.836s
sys 0m0.624s
```

`fzy`
```
$> time cat arwiki-latest-abstract1.xml | fzy -e 'هذه تجربة' | wc -l
6479
real 0m0.389s
user 0m1.352s
sys 0m0.267s
```

`+x +i --algo=v1 --literal` really helps, but there remains a big difference
```
$> time cat arwiki-latest-abstract1.xml | fzf +x +i --algo=v1 --literal -f 'هذه تجربة' | wc -l
6427

real 0m1.925s
user 0m2.761s
sys 0m0.494s
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided Linux and macOS shell benchmarks with the Arabic dataset and compare fzf's timings against fzy. Investigate the fzf filtering entry point and profiling results; done means reducing the Arabic-search performance gap without regressing the documented search behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.