From f103e85f8896fbdeb40d40cf1ff3dea1be1de88a Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Fri, 8 May 2026 12:06:11 -0500 Subject: [PATCH] perf(ci): precompile el_runtime.o once for all native test modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit el_runtime.c was being compiled from source for each of the 8 native test modules. A single precompile step produces el_runtime.o which all 8 link steps reuse — eliminates 7 redundant gcc runtime compilations. --- .gitea/workflows/ci-dev.yaml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index 3572c95..b3071dc 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -84,13 +84,22 @@ jobs: bash tests/html_sanitizer/run.sh # Native El test suites (elc --test, compile-link-run) + # el_runtime.c is precompiled to .o once and reused by all 8 modules. + - name: Precompile el_runtime.o + run: | + set -euo pipefail + RUNTIME="$(pwd)/el-compiler/runtime" + gcc -O2 -c -I "$RUNTIME" "$RUNTIME/el_runtime.c" \ + -o /tmp/el_runtime.o + echo "el_runtime.o compiled" + - name: Run tests - native (core) run: | set -euo pipefail ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_core.el > /tmp/el_native_core.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_core.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_core /tmp/el_native_core @@ -100,7 +109,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_text.el > /tmp/el_native_text.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_text.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_text /tmp/el_native_text @@ -110,7 +119,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_string.el > /tmp/el_native_string.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_string.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_string /tmp/el_native_string @@ -120,7 +129,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_math.el > /tmp/el_native_math.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_math.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_math /tmp/el_native_math @@ -130,7 +139,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_state.el > /tmp/el_native_state.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_state.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_state /tmp/el_native_state @@ -140,7 +149,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_time.el > /tmp/el_native_time.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_time.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_time /tmp/el_native_time @@ -150,7 +159,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_json.el > /tmp/el_native_json.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_json.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_json /tmp/el_native_json @@ -160,7 +169,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_env.el > /tmp/el_native_env.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_env.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_env /tmp/el_native_env @@ -170,7 +179,7 @@ jobs: ELC="$(pwd)/dist/platform/elc" RUNTIME="$(pwd)/el-compiler/runtime" "$ELC" --test tests/native/test_fs.el > /tmp/el_native_fs.c - gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c "$RUNTIME/el_runtime.c" \ + gcc -O2 -I "$RUNTIME" /tmp/el_native_fs.c /tmp/el_runtime.o \ -lcurl -lssl -lcrypto -lpthread -lm -o /tmp/el_native_fs /tmp/el_native_fs -- 2.52.0