Discussion:
Perf : put all the code in one source file only ?
Alain Meunier
2014-08-02 17:23:18 UTC
Permalink
Hello,

My question is purely theorical : what are the eventual disadvantages of putting a lot of functions in the same main.c file instead of spanning them into multiple static libraries ?

How will gcc sort this out ?

This question is neither related to maintainability, nor readability, nor executable size, nor ram usage.

Just performance.

Will the code units play a role or something ? Or whatever I don't think of ?

Will the perf will be the same ?

Thanks,
Alain Meunier
2014-08-03 07:37:52 UTC
Permalink
Thanks,

Why would I use flto with a single file at the first place ?

________________________________
Date: Sat, 2 Aug 2014 14:12:31 -0400
Subject: RE: Perf : put all the code in one source file only ?
Single file permits some auto inlining even without flto.
Tim Prince
-------- Original message --------
Subject: Perf : put all the code in one source file only ?
Hello,
My question is purely theorical : what are the eventual disadvantages
of putting a lot of functions in the same main.c file instead of
spanning them into multiple static libraries ?
How will gcc sort this out ?
This question is neither related to maintainability, nor readability,
nor executable size, nor ram usage.
Just performance.
Will the code units play a role or something ? Or whatever I don't think of ?
Will the perf will be the same ?
Thanks,
Continue reading on narkive:
Search results for 'Perf : put all the code in one source file only ?' (Questions and Answers)
6
replies
how to build a circuit for solar lamp?
started 2006-11-10 07:39:24 UTC
maintenance & repairs
Loading...