Skip to content

Conversation

@wenyongh
Copy link
Contributor

Build several projects in wamr-test-suites with multiple cores to reduce
the compilation time.

Merge bytecodealliance:main into wenyongh:main
Apply clang-format for core/shared and product-mini files (#785)
Merge bytecodealliance:main into wenyongh:main
Enhance spec test workflow to support x86_32 target (#787)
Merge bytecodealliance:main into wenyongh:main
Merge wasm-micro-runtime:main into wenyongh:main
Apply clang-format for more source files (#795)
And fix host_tool help show issue.
Disable source debugging by default (#804)
Merge bytecodealliance:main into wenyongh:main
Merge bytecodealliance:main into wenyongh:main
# keep going and do not care if it is success or not
make -ki clean | true
cmake ${compile_flag} ${WORK_DIR}/../../unit && make
cmake ${compile_flag} ${WORK_DIR}/../../unit && make -j 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had better use $(nproc)

Suggested change
cmake ${compile_flag} ${WORK_DIR}/../../unit && make -j 4
cmake ${compile_flag} ${WORK_DIR}/../../unit && make -j $(nproc)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nproc may not be installed. 4 might be a safe option

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so let's use -j 4.
Another place to reduce the workloads compilation time is building iwasm in compilation_on_android_ubuntu_macos.yml, currently we get llvm libraries
before building iwasm for each mode, in fact we only need to get llvm libraries
for the mode jit and lazyjit. For fast/classic interpreter mode and aot mode,
we don't need to get the llvm libraires, is it easy to add condition check
in the scripts?

- name: Get LLVM libraries
        id: cache_llvm
        if: ${{ matrix.light == 'green' }}
        uses: actions/cache@v2
        with:
          path: |
            ./core/deps/llvm/build/bin
            ./core/deps/llvm/build/include
            ./core/deps/llvm/build/lib
            ./core/deps/llvm/build/libexec
            ./core/deps/llvm/build/share
          key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}

e.g. modify this line: if: ${{ matrix.light == 'green' }} to something like:

if: ${{ matrix.light == 'green'
        && (make_options_run_mode == $JIT_BUILD_OPTIONS
            || make_options_run_mode == $LAZY_JIT_BUILD_OPTIONS)
     }}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time consumption is defined by the longest job in parallel mode. In our workflow, the followings will not start until all five build_iwasm jobs are finished.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be total 243 build_iwasm jobs but not five in compilation_on_android_ubuntu_macos.yml:
https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/1402357515
build_iwasm
It is the longest phase in all the workflows.
Currently each build_iwasm job will get LLVM libraries firstly which costs some time, but there
are a lot of interpreter/aot mode jobs which don't need llvm libraries, if we can skip this step for them,
we should be able to reduce the total time of 243 build_iwasm jobs, so as to reduce the total time of
all workflows.

&& cd build \
&& cmake .. \
&& make
&& make -j 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@xujuntwt95329
Copy link
Collaborator

LGTM

@wenyongh wenyongh merged commit 4d14e41 into bytecodealliance:main Oct 30, 2021
wenyongh referenced this pull request in wenyongh/wasm-micro-runtime Oct 30, 2021
Build projects in wamr-test-suites with multiple cores (#811)
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…nce#811)

Build several projects in wamr-test-suites with multiple cores to reduce
the compilation time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants