浏览代码

docs(theme): specify perf improvements

Mostly in case we decide that the complexity is too unweildy in the
future, having some idea what the blast radius is will be helpful.
Christina Sørensen 9 月之前
父节点
当前提交
0f0d99c46e
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      src/theme/mod.rs

+ 9 - 6
src/theme/mod.rs

@@ -211,13 +211,16 @@ struct ExtensionMappings {
 }
 }
 
 
 #[derive(PartialEq, Debug)]
 #[derive(PartialEq, Debug)]
-/// Using a hashmap here for "simple" patterns (plain extensions like '*.txt') improves performance
-/// drastically. It doesn't change highlighting behavior, as we still walk the
-/// [`ExtensionMappings`] in reverse order, and the hashmap will only consist of disjoint sets (it
-/// doesn't matter in which order we search *.txt or *.pdf).
+/// Using a hashmap here for "simple" patterns (plain extensions like '*.txt')
+/// improves performance drastically for complex `LS_COLORS` usage (see
+/// <https://github.com/eza-community/eza/pull/1421#issuecomment-2816666661>).
 ///
 ///
-/// In the event that a pattern shows up twice, we will use the later one (since .insert overrides
-/// any entry that exists), which is the correct behavior.
+/// It doesn't change highlighting behavior, as we still walk the
+/// [`ExtensionMappings`] in reverse order, and the hashmap will only consist of
+/// disjoint sets (it doesn't matter in which order we search *.txt or *.pdf).
+///
+/// In the event that a pattern shows up twice, we will use the later one (since
+/// .insert overrides any entry that exists), which is the correct behavior.
 enum GlobPattern {
 enum GlobPattern {
     Complex(glob::Pattern, Style),
     Complex(glob::Pattern, Style),
     Simple(HashMap<String, Style>),
     Simple(HashMap<String, Style>),