From 52c28d4f76867706a8e699913c3647a6b8566a67 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 4 Mar 2024 17:27:48 +0800 Subject: [PATCH] docs: new tip for making yazi even faster than fast --- docs/configuration/yazi.md | 4 ++-- docs/tips.md | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/configuration/yazi.md b/docs/configuration/yazi.md index 22b1a58a..78e09014 100644 --- a/docs/configuration/yazi.md +++ b/docs/configuration/yazi.md @@ -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. @@ -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. diff --git a/docs/tips.md b/docs/tips.md index 92ad97e5..01c33e0f 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -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.