perf: pre-allocate status info collections with known capacities
This commit is contained in:
@@ -89,7 +89,7 @@ pub fn generate_status_info(
|
||||
};
|
||||
|
||||
let _default_type = crate::compression_engine::default_compression_type();
|
||||
let mut compression_info = Vec::new();
|
||||
let mut compression_info = Vec::with_capacity(CompressionType::iter().count());
|
||||
|
||||
// Sort compression types by their string representation
|
||||
let mut sorted_compression_types: Vec<CompressionType> = CompressionType::iter().collect();
|
||||
@@ -141,7 +141,8 @@ pub fn generate_status_info(
|
||||
});
|
||||
}
|
||||
|
||||
let mut meta_plugins_map = std::collections::HashMap::new();
|
||||
let mut meta_plugins_map =
|
||||
std::collections::HashMap::with_capacity(MetaPluginType::iter().count());
|
||||
let mut enabled_meta_plugins_vec = Vec::new();
|
||||
|
||||
// Sort meta plugin types by their string representation to avoid creating plugins just for sorting
|
||||
|
||||
Reference in New Issue
Block a user