Improve performance
This commit is contained in:
parent
2708759d39
commit
e9a00d51c9
1 changed files with 5 additions and 5 deletions
|
@ -535,7 +535,7 @@
|
|||
" return latest_msg\n",
|
||||
"\n",
|
||||
" msgs = [_pub_latest_msg_before(pub, inst) for pub in pubs]\n",
|
||||
" msgs = [msg for msg in msgs if msg is not None]\n",
|
||||
" msgs = list(filter(None, msgs))\n",
|
||||
" msgs.sort(key=lambda i: i.timestamp, reverse=True)\n",
|
||||
" if msgs:\n",
|
||||
" msg = msgs[0]\n",
|
||||
|
@ -561,7 +561,7 @@
|
|||
" return None\n",
|
||||
"\n",
|
||||
" insts = [_cb_to_chronological_inst(cb, inst) for cb in dep_cbs]\n",
|
||||
" insts = [inst for inst in insts if inst is not None]\n",
|
||||
" insts = list(filter(None, insts))\n",
|
||||
" return insts\n",
|
||||
"\n",
|
||||
"\n",
|
||||
|
@ -660,9 +660,9 @@
|
|||
" f\"[WARN] Expected inst to be of type TrPublishInstance or TrCallbackInstance, got {type(inst).__name__}\")\n",
|
||||
" return None\n",
|
||||
" #print(\"Rec level\", lvl)\n",
|
||||
" deps = [dep for dep in deps if dep is not None]\n",
|
||||
" deps = list(filter(None, deps))\n",
|
||||
" deps = [get_dep_tree(dep, lvl + 1, set(visited), children_are_dep_cbs, start_time) for dep in deps]\n",
|
||||
" deps = [dep for dep in deps if dep is not None]\n",
|
||||
" deps = list(filter(None, deps))\n",
|
||||
" return DepTree(inst, deps)"
|
||||
],
|
||||
"metadata": {
|
||||
|
@ -688,7 +688,7 @@
|
|||
" pubs = end_topic.publishers\n",
|
||||
" for pub in pubs:\n",
|
||||
" msgs = list(pub.instances)\n",
|
||||
" for msg in tqdm(msgs, desc=\"Processing output messages\"):\n",
|
||||
" for msg in tqdm(msgs, mininterval=5.0, desc=\"Processing output messages\"):\n",
|
||||
" msg: TrPublishInstance\n",
|
||||
" tree = get_dep_tree(msg)\n",
|
||||
" all_trees.append(tree)\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue