aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-07-09 16:01:17 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-07-09 16:01:28 +0300
commite874ddb8cee278eded7611cecbc8b2b086e3d6c9 (patch)
tree4dc2e9f318c7e46ca2baef884801825d01f51aca /README.md
parentf95b9ab26942abab844543151c025cead34cca5a (diff)
downloadbcgen-e874ddb8cee278eded7611cecbc8b2b086e3d6c9.tar.gz
bcgen-e874ddb8cee278eded7611cecbc8b2b086e3d6c9.zip
add notes about compilation speed
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 10db0dc..385a4c4 100644
--- a/README.md
+++ b/README.md
@@ -165,3 +165,22 @@ stack/frame register(s), callee-save vs. caller-save, etc. How the stack should
be passed to the bytecode is still TODO, at the moment you can preallocate the
stack and pass it in as an immediate to an instruction, but this feels clunky
and I don't like it.
+
+# Slow compilation times
+
+With massive systems, some optimizations passes have essentially no effect
+but take up an immense amount of time.
+
+GCC users should compile `bcode.c` with `-fno-tree-fre -fno-gcse
+-fno-expensive-optimizations`. This seems to have minimal impact on runtime
+performance, but has massive cost savings on compilation time. `-fno-gcse` is
+recommended by the GCC manual for computed gotos, though I didn't see any
+improvement in the generated code on x86. Maybe other architectures benefit
+from it more? Dunno. `-fno-tree-slp-vectorize` can also be useful to decrease
+memory usage, but doesn't seem to have too much of an effect on the compilation
+speed.
+
+LLVM users should use `-fno-slp-vectorize` which does help a bit, but
+`-ftime-report` doesn't show any obvious other flags that should be turned off.
+I'm sure there are, I just haven't looked hard enough. In any case, GCC I
+suppose is the currently recommended compiler.