Skip to content
Snippets Groups Projects
Commit 34ee8d17 authored by Daniel Silverstone's avatar Daniel Silverstone
Browse files

_yaml.py: Only retrieve provenance in node_get() when needed


We were indiscriminately retrieving the node's provenance data in the
`node_get()` function which was accounting for approximately a third of
the total runtime of `node_get()` which dominates pre-scheduler time in
`bst build`.  This change ameliorates that situation by only retrieving
the provenance data when it's actually needed.

Signed-off-by: default avatarDaniel Silverstone <daniel.silverstone@codethink.co.uk>
parent 1a75b252
No related branches found
No related tags found
Loading
......@@ -365,8 +365,8 @@ _sentinel = object()
#
def node_get(node, expected_type, key, indices=None, *, default_value=_sentinel, allow_none=False):
value = node.get(key, default_value)
provenance = node_get_provenance(node)
if value is _sentinel:
provenance = node_get_provenance(node)
raise LoadError(LoadErrorReason.INVALID_DATA,
"{}: Dictionary did not contain expected key '{}'".format(provenance, key))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment