Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is a required library file always read?

Status
Not open for further replies.

Tyger

Programmer
Sep 19, 2001
21
GB
As I am attempting to build a number of programs which must be capable of handling a high volume of traffic, I am concerned about unecessary harddisk and processor activity on the host server.

If in a program I have the line:
require "prog.lib";
Will this file be read regardless of whether my main program calls any of the subroutines in the library?

In other words do library files simply make orgainisation easier or, by not having the subroutines in the main program, do I save the processor time of reading in lines of code that are not going to be executed?
 
require is an executable statement, and will ALWAYS read the required file, AND COMPILE IT. If you're concerned about it, you can do the require conditionally, only when you discover that you actually need it. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top