Skip to content

Performance regression from !1563 in `bst show`

from bst build bootstrap/bash.bst in freedesktop-sdk-19.08.0-bst2 reported by @BenjaminSchubert

Current hypothesis is that this is related to the increase in calls to Element._source_cached() in Element._calculate_cache_key() (https://gitlab.com/BuildStream/buildstream/blob/master/src/buildstream/element.py#L2221). This was required to correctly resolve the state of workspaced elements using the new workspace source plugin as an alternative to the more invasive refactoring of the logic to updating element states. This could be mitigated by only forcibly recalculating source keys for workspace sources but more correctly this should be resolved by simplifying the logic of element state updating such that workspace sources are correctly handled in a similar way to other source plugins.

This work would benefit from some discussion about how workspaces should be handled going forward to decide if the test behaviour is still relevant. For example, most the additional workspace logic in element states is in place to invalidate the keys and/or manipulate the element state. When the element is loaded and there is a workspace the keys are considered unstable and they are reset. It's also assumed that any element should be cached after a build even with an open workspace. The purpose is to prevent unnecessary rebuilds, however, the correct behaviour is arguably to calculate the key of the workspace and check the cache for artifacts rather than the existing stable/unstable status.

Edited by Darius Makovsky
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information