From ea3a40d073b2440cfce413e0bf20bc79c1d43ab1 Mon Sep 17 00:00:00 2001 From: raistlin7447 Date: Wed, 23 Sep 2026 09:27:42 -0500 Subject: [PATCH] libslic3r: move the filament library's config map instead of copying it Every preset of the filament library keeps its config for other vendors to inherit from, and publishing that map copied all 1281 of them. The map it is built in is cleared by the next install before anything reads it again, so the copy was of no use to anyone. Loading the library goes from 145 to 86 ms, and the whole preset load from 360 to 300 ms. --- src/libslic3r/PresetBundle.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 81ca7c642f..2a2b9d6b54 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -7328,8 +7328,10 @@ std::pair PresetBundle::load_vendor_configs_ const auto is_orca_lib = vendor_name == ORCA_FILAMENT_LIBRARY; load_subfiles(filament_subfiles, cache_data.filament_entries, "filament", is_orca_lib); if (is_orca_lib) { - m_config_maps = configs; - m_filament_id_maps = filament_id_maps; + // The next install clears `configs` before using it again, and for the + // library it holds a full config for every one of its presets. + m_config_maps = std::move(configs); + m_filament_id_maps = std::move(filament_id_maps); } //3.3) paste the printers @@ -8163,8 +8165,10 @@ bool PresetBundle::load_vendor_cache(const std::string& cache_path, const std::s const bool is_orca_lib = vendor_name == ORCA_FILAMENT_LIBRARY; install_entries(data.filament_entries, &this->filaments, is_orca_lib); if (is_orca_lib) { - m_config_maps = configs; - m_filament_id_maps = filament_id_maps; + // The next install clears `configs` before using it again, and for the + // library it holds a full config for every one of its presets. + m_config_maps = std::move(configs); + m_filament_id_maps = std::move(filament_id_maps); } install_entries(data.machine_entries, &this->printers, false); return true;