]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coccinelle: dial back warnings about performance
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 26 Dec 2023 18:39:12 +0000 (19:39 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 27 Dec 2023 10:15:48 +0000 (11:15 +0100)
Turns out I _really_ underestimated the impact of
--include-headers-for-types, as it significantly reduces both runtime
and storage penalties. For example, on my machine the runtime of
uncached run goes down from ~15 minutes to ~2 minutes, and similarly the
total storage needed by the cache goes from ~15 GiB down to ~3 GiB.

coccinelle/run-coccinelle.sh

index cc2bfc14c5d5174cf2dee23c2e9438aed327b7a3..79536b38954e51220249f34c04766cc6b848eed6 100755 (executable)
@@ -43,10 +43,6 @@ fi
 
 mkdir -p "$CACHE_DIR"
 echo "--x-- Using Coccinelle cache directory: $CACHE_DIR"
-echo "--x--"
-echo "--x-- Note: running spatch for the first time without populated cache takes"
-echo "--x--       a _long_ time (15-30 minutes). Also, the cache is quite large"
-echo "--x--       (~15 GiB), so make sure you have enough free space."
 echo
 
 for script in "${SCRIPTS[@]}"; do
@@ -69,10 +65,8 @@ for script in "${SCRIPTS[@]}"; do
     #
     # 4) Explicitly undefine the SD_BOOT symbol, so Coccinelle ignores includes guarded by #if SD_BOOT
     #
-    # 5) Use cache, since generating the full AST is _very_ expensive, i.e. the uncached run takes 15 - 30
-    # minutes (for one rule(!)), vs 30 - 90 seconds when the cache is populated. One major downside of the
-    # cache is that it's quite big - ATTOW the cache takes around 15 GiB, but the performance boost is
-    # definitely worth it
+    # 5) Use cache, since generating the full AST is expensive. With cache we can do that only once and then
+    #    reuse the cached ASTs for other rules. This cuts down the time needed to run each rule by ~60%.
     parallel --halt now,fail=1 --keep-order --noswap --max-args=10 \
         spatch --cache-prefix "$CACHE_DIR" \
                -I src \