Skip to content

Build core libs with -O0 in debug - #1163

Merged
jeaye merged 1 commit into
mainfrom
compile-times
Oct 27, 2026
Merged

jeaye merged 1 commit into
mainfrom
compile-times

Conversation

@jeaye

@jeaye jeaye commented Oct 27, 2026

Copy link
Copy Markdown
Member

This cuts down core lib compile times by about 60%.

This cuts down core lib compile times by about 60%.
@jeaye
jeaye merged commit ed7bc16 into main Oct 27, 2026
23 checks passed
@jeaye
jeaye deleted the compile-times branch October 27, 2026 19:53
@kylc

kylc commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Is -Og supported by the jank compiler? I get this when compiling in RelWithDebInfo now:

cd /home/kyle/code/jank/compiler+runtime/build && /home/kyle/code/jank/compiler+runtime/build/jank-phase-1 -Og --force-binary-version 0 compile-module --target-dir /home/kyle/code/jank/compiler+runtime/build/core-libs --output-target object clojure.core && /home/kyle/code/jank/compiler+runtime/build/jank-phase-1 -Og --force-binary-version 0 compile-module --target-dir /home/kyle/code/jank/compiler+runtime/build/core-libs --output-target cpp clojure.core && /home/kyle/code/jank/compiler+runtime/build/jank-phase-1 -Og --force-binary-version 0 compile-module --target-dir /home/kyle/code/jank/compiler+runtime/build/core-libs --output-target cpp jank.nrepl.server.core && touch /home/kyle/code/jank/compiler+runtime/build/classes/core-libraries
error: Invalid optimization level 'g'.

Maybe it should just be -O3, since I think debug symbols are enabled by default unless --no-debug. Maybe Release should have --no-debug?

@jeaye

jeaye commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Is -Og supported by the jank compiler? I get this when compiling in RelWithDebInfo now:

Oh shoot, you're right. We need -O3 there.

Maybe it should just be -O3, since I think debug symbols are enabled by default unless --no-debug. Maybe Release should have --no-debug?

Hmmm, I think if phase 2 is enabled, we really don't need debug info since we're just generating C++ files. The debug info only matters if we're debugging JIT compiled stuff (we're not, in this case) or generating object files (also not, in this case).

@jeaye

jeaye commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

I'll follow up with a fix for that shortly.

@jeaye

jeaye commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Ok, I have fixed the -Og usage here: #1167

I have also created this ticket to address the appeal of --no-debug for cpp codegen: #1168 Right now, we can't skip the debug for JIT compilation while also having source mapping done on the generated cpp files and that's a shame.

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.

2 participants