Skip to content

Conversation

@dimitre
Copy link
Member

@dimitre dimitre commented Nov 12, 2024

This PR removes some includes from ofConstants.h and include by demand where needed.
includes are:

#include <stdint.h>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <iostream>
#include <vector>
#include <memory>
#include <functional>

We can add them to ofMain.h to assure they are still added on projects

Linux action runner is failing because of libgconf-2-4

@dimitre dimitre marked this pull request as ready for review November 13, 2024 01:29
@dimitre dimitre requested a review from ofTheo November 13, 2024 01:33
@dimitre
Copy link
Member Author

dimitre commented Nov 13, 2024

good to go. should we re-add includes in ofMain.h to keep all of them available ?

@dimitre
Copy link
Member Author

dimitre commented Nov 17, 2025

I've brought this PR to be compatible with master
if it is a good idea lets merge or discuss it
if not merged I'll be closing by November 24 (PR birthday)

cc @ofTheo @NickHardeman @artificiel

@dimitre dimitre added the close label Nov 17, 2025
@ofTheo
Copy link
Member

ofTheo commented Nov 17, 2025

Thanks @dimitre - have you benchmarked the compile time difference with this change and without?
I'm all for speeding up compile times and it would be good to know if this PR has a significant impact.

Generally ofConstants.h is where these things are meant to live, so moving to ofMain.h would only make sense if we can see a big speed up.

Thanks!
Theo

@dimitre
Copy link
Member Author

dimitre commented Nov 17, 2025

@ofTheo I didnt think it would make much differente but in fact if we compare the runners in this one against another normal PR like this we see improvement in compile times in all runners. sometimes less than 50% original time.
take a look:

https://github.com/openframeworks/openFrameworks/pull/8187/checks
https://github.com/openframeworks/openFrameworks/actions/runs/19430409178/job/55587700525

This PR removes lots of unneeded system includes (sometimes they are huge) so compiler has much less lines to process

@ofTheo
Copy link
Member

ofTheo commented Nov 18, 2025

@dimitre wow, yes, I see the difference too!
Weird that VS seems unaffected but msys2 has the same 50% speed up.

Seems worth it for the speed up alone and people typically include ofMain.h so seems fairly safe

@ofTheo ofTheo merged commit 3f45723 into openframeworks:master Nov 18, 2025
17 checks passed
@dimitre dimitre deleted the inc branch November 18, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants