"""[DEBUG-perf1] 首页 /summary 计时基线(临时,诊断后删除)。""" from time import perf_counter from app import create_app from app.services.in_transit_transfer.backlog_service import ( _pending_match_counts, backlog_summary, list_backlog, ) app = create_app() with app.app_context(): t0 = perf_counter() items = list_backlog() t1 = perf_counter() pm, m = _pending_match_counts() t2 = perf_counter() s = backlog_summary() t3 = perf_counter() print(f"[DEBUG-perf1] list_backlog rows={len(items)}: {t1 - t0:.2f}s") print(f"[DEBUG-perf1] _pending_match_counts pending={pm} matchable={m}: {t2 - t1:.2f}s") print(f"[DEBUG-perf1] backlog_summary total: {t3 - t2:.2f}s (pending={s.pending_match_count}, matchable={s.matchable_count})")