Re: Report on include file use

new topic     » goto parent     » topic index » view thread      » older message » newer message

DB James wrote:
> 
> Here are the results of checking on the use of include files.
> 
> Timing test to detect any "penalty" connected with include files.
> Used time{} and Verne Tice's hrtime.e library ( hrtime() ).
> 
> All Eu official include files were put in one file called all.e.
> Note: safe.e was skipped because it is very slow.
> 
> Time the load of a big include file
> *** all.e load: time(): 0.000000  hrtime(): 0.000170 ***
> 
> Ran three functions each ten million times -- the times shown represent
> timing one million calls per function and run ten times and averaged.
> ("top" refers to a function at the top of the include file, and
> "bottom" is at the bottom of the include file.
> 
> * Million calls to add_ten(): time(): 0.502000  hrtime(): 0.540990 *
> * Million calls to add_ten_top(): time(): 0.514000  hrtime(): 0.550129 *
> * Million calls to add_ten_bottom(): time(): 0.522000  hrtime(): 0.550388 *
> 
> Conclusion: there is no significant penalty for the load time of
> included file(s) nor for the calling of functions within the
> included file(s) as compared with calling a function not part
> of an include file.
> 
> After compiling the file both with and without the all.e include file,
> I found a slight increase in size of the resulting file, but the
> increase is a small fraction of the include file size.
> 
> Bottom line: here is not a significant penalty for using one or many
> include files (I checked times also of loading many include files).
> 
> --Quark

Are you timing within your test program or external to it?

Because include files are parsed at the same time the main program is. If you
are timing from within your test program then you are only testing the time of
your test program, not on the load time of any sources (including include files).

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu