mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 03:42:05 +00:00
Dedupe json traversal (#13334)
* WIP: benchmarking caching vs multi-thread parsing json * stick to just caching, other functions does not seem to have any duplicate traversals * Remove benchmarking code * cleanup leftover code and clear cache when loading is done --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "slic3r/Utils/PresetUpdater.hpp"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
@@ -135,6 +137,14 @@ private:
|
||||
|
||||
wxString m_bbl_user_agent;
|
||||
std::string m_editing_filament_id;
|
||||
|
||||
struct CachedFilamentInfo
|
||||
{
|
||||
int status{-1};
|
||||
std::string vendor;
|
||||
std::string type;
|
||||
};
|
||||
std::unordered_map<std::string, CachedFilamentInfo> filament_info_cache;
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
Reference in New Issue
Block a user