Skip to content

Conversation

gudnimg
Copy link
Contributor

@gudnimg gudnimg commented Oct 3, 2025

Summary

  • Speed up the execution time of find_v2_boards() if the board name is already known and avoid call to rglob. This change both reduces memory used and also IO activity on the file system.
  • 85acca8 Fixes an issue when using the new fast path. The folder path should contain a valid board name, especially when it is being extended with new variants. If boards/native/native_sim/board.yml is being extended, the folder path for the new variants should be the same, and not boards/native/native_sim_extend/board.yml. In other words, the <board> name should match.

Comparison

On my machine I see the execution time drop from ~1.6 seconds to ~0.5 seconds. In my screenshots below 1.506 seconds drops to 0.556 seconds. When sysbuild is enabled, the time savings are doubled because this process is executed twice.

My machine uses AMD Ryzen 5800X3D, 32GB RAM and Windows 11 (26100.6584).

Before After
image image

How to reproduce:

These are the simplest steps I could come up with

  1. Setup the Example Application https://github.com/zephyrproject-rtos/example-application
  2. Change west.yml to point to this PR's source branch and run west update -o=--depth=1 --narrow
image
  1. Run the build with profiling west build --pristine always -b custom_plank app --cmake -- --profiling-format=google-trace --profiling-output=cmake-configure-trace.json
  2. Open https://ui.perfetto.dev and open cmake-configure-trace.json in the UI

@gudnimg gudnimg force-pushed the find-v2-boards-fast-path branch from dfb76e1 to d0fec5a Compare October 4, 2025 15:08
Speed up the execution time of find_v2_boards() if the board name is
already known and avoid call to rglob. This change both reduces memory
used and also IO activity on the file system.

On my machine I see the execution time drop from ~1.6 seconds to ~0.5
seconds. When sysbuild is enabled, the time savings are doubled.

Signed-off-by: Guðni Már Gilbert <[email protected]>
The board directory is expected to follow this convention:
boards/<vendor>/<board>/board.yml

This test is extending native_sim board and so the folder path should use
'native_sim' for <board> and not 'native_sim_extend'.

Signed-off-by: Guðni Már Gilbert <[email protected]>
@gudnimg gudnimg force-pushed the find-v2-boards-fast-path branch from d0fec5a to 85acca8 Compare October 4, 2025 15:19
Copy link

sonarqubecloud bot commented Oct 4, 2025

@gudnimg gudnimg marked this pull request as ready for review October 4, 2025 15:56
@zephyrbot zephyrbot added area: Build System area: Tests Issues related to a particular existing or missing test labels Oct 4, 2025
@gudnimg
Copy link
Contributor Author

gudnimg commented Oct 4, 2025

The ~550ms that are left, half the time seems to go into importing Python modules, and half goes into list_hardware.find_v2_systems(root_args) as all socs are searched with rglob. Perhaps something which can be improved later. If we know the location of board.yml, then we should be able to limit where soc.yml is found by vendor.

Edit: searching SOC vendor by Board vendor won't work. The board may have a custom vendor, while the SOC uses another vendor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants