Skip to content

Commit

Permalink
docs: new tip for making yazi even faster than fast
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Mar 4, 2024
1 parent e87d6e0 commit 52c28d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/configuration/yazi.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ An array of `[width, height]`, maximum image size (in pixels) for decoding a sin

### previewers

You can prepend or append new preview rules to the default `previewers` under `[plugin]` by `prepend_previewers` and `append_previewers`.
You can prepend or append new preview rules to the default `previewers` under `[plugin]` by `prepend_previewers` and `append_previewers`, see [Configuration mixing](/docs/configuration/overview#configuration-mixing) for details.
Here are the available options for a single rule:

- `name` (String): Glob expression for matching the file name. Case insensitive by default, add `\s` to the beginning to make it sensitive.
Expand Down Expand Up @@ -257,7 +257,7 @@ If you want to create your own previewer, see [Previewer API](../plugins/overvie

### preloaders

You can prepend or append new preview rules to the default `preloaders` under `[plugin]` by `prepend_preloaders` and `append_preloaders`.
You can prepend or append new preview rules to the default `preloaders` under `[plugin]` by `prepend_preloaders` and `append_preloaders`, see [Configuration mixing](/docs/configuration/overview#configuration-mixing) for details.
Here are the available options for a single rule:

- `name` (String): Glob expression for matching the file name. Case insensitive by default, add `\s` to the beginning to make it sensitive.
Expand Down
9 changes: 9 additions & 0 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,12 @@ Copy the [`Header:render()` method](https://github.com/sxyazi/yazi/blob/main/yaz
return {
ui.Paragraph(chunks[1], { left }),
```

## Make Yazi even faster than fast

While Yazi is already fast, there is still plenty of room for optimization for specific users or under certain conditions:

- For users who don't need image previews at all, disabling the default `image` previewer and preloader will make Yazi faster by reducing the I/O read file and CPU decode image consumption.
- For users managing network files, it's recommended to disable all previewers and preloaders since previewing and preloading these files means they need to be downloaded locally.
- For low-spec devices like Raspberry Pi, [reducing the concurrency](/docs/configuration/yazi#tasks) will make Yazi faster since the default configuration is optimized for PCs, and high concurrency on these low-spec devices may have the opposite effect.
- For users who don't need accurate mime-type, [`mime.yazi`](https://github.com/DreamMaoMao/mime.yazi) may be useful, as it simply returns mime-type based on file extensions, while Yazi defaults to obtaining mime-type based on file content for accuracy. Mime-type is used for matching opening, previewing, rendering rules. Encourage users to choose the appropriate `mime` plugin based on their needs, which is why we decided to open it up to plugin developers.

0 comments on commit 52c28d4

Please sign in to comment.