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:
Ian Chua
2026-04-24 13:54:09 +08:00
committed by GitHub
parent aa4dd7dfd5
commit 9c046c7c24
2 changed files with 38 additions and 4 deletions

View File

@@ -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