Startup-Diagnose: Imports + Display-Modes + Window-Layout messen

Bisher: Wall-time 3.2s vs gemessene Arbeit 0.9s → 2.3s unmeasured.
Jetzt werden auch die bisher blinden Stellen getrackt:

- 9× Modul-Import (rhinopanel, oberleiste, ausschnitte, ...) als
  phase="import", label=mod_id
- oberleiste display-mode-Ensure-Loop (4× DisplayModeDescription-Calls)
  als phase="display_modes"
- _apply_window_layout RunScript-Sequenz als phase="window_layout"
- text_editor doppelklick-Hook + view-modes assign + unit-check als
  post_init/hook Phases

Nach Reload sollte das Summary zeigen wo die 2.3s versickern → daraus
gezielte Optimierungen.
This commit is contained in:
2026-05-27 19:08:02 +02:00
parent 61923e1b2b
commit 6fee7bd143
2 changed files with 26 additions and 0 deletions
+11
View File
@@ -263,28 +263,39 @@ def _load_all(sender, e):
print("[STARTUP] Keine dossier.project.json — alle Module laden")
# massstab.py wird als Library mitgeladen (von oberleiste/ausschnitte/...)
# und braucht hier nicht mehr als eigenstaendiges Panel zu erscheinen.
# Imports messen — das ist der grosse Block der bisher unmeasured war
import time as _t
import panel_base as _pb
for mod_id in enabled_ids:
py_name = _MODULE_TO_PY[mod_id]
_t_imp = _t.time()
try:
__import__(py_name)
_pb._t_mark("import", mod_id, _t_imp)
print("[STARTUP] {} ({}) OK".format(mod_id, py_name))
except Exception as ex:
print("[STARTUP] {} ({}) FEHLER: {}".format(mod_id, py_name, ex))
# Text-Editor Doppelklick-Hook fuer DOSSIER-Texte
_t_te = _t.time()
try:
import text_editor
text_editor._ensure_double_click_hook()
_pb._t_mark("hook", "text_editor", _t_te)
except Exception as ex:
print("[STARTUP] text_editor hook:", ex)
# Display-Modes auf Default fuer aktives Doc setzen (einmalig)
_t_vm = _t.time()
try:
_assign_default_display_modes(Rhino.RhinoDoc.ActiveDoc)
_pb._t_mark("post_init", "view_modes", _t_vm)
except Exception as ex:
print("[STARTUP] view-modes assign:", ex)
# Unit-Check fuer das beim Start aktive Doc — fragt einmal pro Doc
# wenn doc.ModelUnitSystem != Project-Setting
_t_uc = _t.time()
try:
_check_doc_unit(Rhino.RhinoDoc.ActiveDoc)
_pb._t_mark("post_init", "unit_check", _t_uc)
except Exception as ex:
print("[STARTUP] unit-check active doc:", ex)
# DOSSIERUI Window-Layout — Hinweis fuer manuelles Laden