Skip to content

disable optimizations and other costly CFLAGS from demos#946

Open
sleeptightAnsiC wants to merge 1 commit intoImmediate-Mode-UI:masterfrom
sleeptightAnsiC:disable_demo_optimizations
Open

disable optimizations and other costly CFLAGS from demos#946
sleeptightAnsiC wants to merge 1 commit intoImmediate-Mode-UI:masterfrom
sleeptightAnsiC:disable_demo_optimizations

Conversation

@sleeptightAnsiC
Copy link
Copy Markdown
Contributor

@sleeptightAnsiC sleeptightAnsiC commented Apr 21, 2026

Demos must compile as fast as possible, in order to be quick to reiterate and retest. Given that each needs to link and recompile amalgamation every time, the difference between -O2 and -O0 is noticeable. This also slightly affects CI times. This topic was discussed under several occasions, for example: #894 (comment) or #895 (comment)

Demos must compile as fast as possible, in order to be quick to
reiterate and retest. Given that each needs to link and recompile
amalgamation every time, the difference between -O2 and -O0 is
noticeable. This also slightly affects CI times. This topic was
discussed under several occasions, for example:
Immediate-Mode-UI#894 (comment)
Immediate-Mode-UI#895 (comment)
cflags += -std=c89 -Wall -Wextra -Wpedantic
cflags += -O2
#cflags += -O0 -g
cflags += -std=c89 -Wall -Wextra -pedantic
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed -Wpedantic to -pedantic (without W) in order to keep it consistent with other demos since I was already touching these lines


web: prepare
emcc $(SRC) -Os -s USE_SDL=2 -o bin/index.html
emcc $(SRC) $(CFLAGS) -s USE_SDL=2 -o bin/index.html
Copy link
Copy Markdown
Contributor Author

@sleeptightAnsiC sleeptightAnsiC Apr 21, 2026

Choose a reason for hiding this comment

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

Danger zone here:

this target was NOT depending on CFLAGS before, but since I don't see any reason against it, and since I was already touching it, I just added it here to keep it consistent with other targets.

I gave it a try and it compiles just fine. It yields a lot of warnings but nothing fatal.

@sleeptightAnsiC
Copy link
Copy Markdown
Contributor Author

sleeptightAnsiC commented Apr 21, 2026

This also slightly affects CI times.

Actually, after taking a look at CI times of my last PRs, it's not just "slightly". From around 110-117sec to 86sec, and that whole difference was taxed by just 3 out of 17 demos. Noooice.

Copy link
Copy Markdown
Contributor

@rswinkle rswinkle left a comment

Choose a reason for hiding this comment

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

Long overdue.

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