Zephyr compile speedup

Despite I have a rather modern machine (Intel i7, 12 cores) and a not too big project, compiling a Zephyr application takes too much time. I'm used to FreeRTOS compilation times being 2-5x faster than this. (Of course, Zephyr code base is larger) If my suspicion is right, substantial part of the overall compilation time is consumed by various build system scripts to parse devicetree, regenerate devicetree-related files and so on. It's mostly just a waste of time, because during a regular development the devicetree isn't touched, so there'd be no need to parse again.

Is there any way to have the Zephyr build system recompile the source files only, without executing time-consuming scripts e.g. to regenerate devicetree stuff?

(there's ccache installed on my machine, it's just working for the GCC-phase of compilation)

Any tips to speed up compile are welcome ;)

thanks, regards,

  • Tamas Selmeci said:
    Could you please give me some hints on what the build system investigates when it decides to regenerate everything or to simply recompile the changes C sources?

    I think the way to best understand how this works is to investigate 'build and configuration systems' and 'Build system (Cmake)' under 'Application development' at https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev.html in your own time

    Tamas Selmeci said:
    In fact, I've added a new board under a directory out of NCS directory tree; and west build is invoked like this:

    Just speculation: it might be related to the board being outside and/or that you're using a custom board that is not listed within ../zephyr/boards or.../nrf/boards

    Kind regards,
    Andreas

Related