perf: skip per-link topology dump during project-open prepare

Stage timing showed prepare taking 96s for 1275 links (vs 0.31s for the
batch dispatch itself). Root cause: _prepare_link_from_topology called
add_link (dump=True default) and update_link_style/update_show_filters_icon
(each unconditionally dump the full topology). 1275 links x serialize-
and-write-the-whole-topology = the entire 96s.

- add_link(..., dump=False): the project is dumped once at the end of open
- set link._link_style / _show_filters_icon directly instead of the
  update_* helpers, which also avoids spurious 'link.updated' notifications
  before the link is finalised

The final self.dump() at the end of project.open already persists everything.
This commit is contained in:
YueGuobin committed 2026-08-10 23:54:26 +08:00
1 parent 38c49a655c
commit c9a93c0aeb
2 files changed
+18 -3

No files matched your search

+1
View File
@@ -85,3 +85,4 @@ venv
# Tiktoken cache files
gns3server/agent/gns3_copilot/cache/tiktoken/
gns3.log