mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 19:31:22 +00:00
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.
This commit is contained in:
@@ -7328,8 +7328,10 @@ std::pair<PresetsConfigSubstitutions, size_t> 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;
|
||||
|
||||
Reference in New Issue
Block a user