Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between compile time ,load time and execution time?

What is the difference between Compile time, Load time and Execution time?

  • Can someone explain me these three terms in a very simple language?
  • It would be easier to understand if you can provide some examples as well.

Context:

Classically, the binding of instructions and data to memory addresses can be done at any step along the way:

  • Compile time. The compiler translates symbolic addresses to absolute addresses. If you know at compile time where the process will reside in memory, then absolute code can be generated (Static).

  • Load time. The compiler translates symbolic addresses to relative (relocatable) addresses. The loader translates these to absolute addresses. If it is not known at compile time where the process will reside in memory, then the compiler must generate relocatable code (Static).

  • Execution time. If the process can be moved during its execution from one memory segment to another, then binding must be delayed until run time. The absolute addresses are generated by hardware. Most general-purpose OSs use this method (Dynamic).

like image 572
Tilak Raj Avatar asked Mar 01 '16 17:03

Tilak Raj


People also ask

What is the difference between runtime and execution time?

Execution Time is the time that your program takes to execute. For example, 10 seconds, or 10 milliseconds. Running time might be used interchangeably with execution time (how much time it takes for your program to terminate).

What's the difference between execution and compilation?

compilation process converts source code into machine code while as execution means that machine code is ready for processing.

What is execution time in compiler?

Execution time refers to the stage at which the instructions in the computer programs/code are executed. At execution time, run-time libraries are used. Some basic operations that occur at execution time include reading program instructions to carry out tasks or complete actions.

What is the difference between compile time binding and load time binding?

Compile time address binding is done before loading the program into memory. Load time address binding is done after loading the program into memory. Instructions are translated into absolute address.


1 Answers

These terms seem self explanatory to me, but here's an attempt at describing them. Links for further reading are included.

Compile time is when your code is being processed by a compiler. In this context, it's talking about a compiler that is transforming your code into an executable binary.

Load time is when the Operating System is reading an executable from long term storage (typically a hard drive) and loading it into short term memory (RAM) from which it can be executed. Generally the hard drive is too slow to feed the CPU, so fast memory is used to store instructions/programs that the CPU is getting ready to execute. This is also when the initial memory allocation is reserved and initialized for use by the program.

Execution time is when a program is executing or running. The instructions are in memory and are being processed by the CPU. Additional memory may be allocated and/or deallocated at this time.

like image 86
CoderDennis Avatar answered Oct 01 '22 04:10

CoderDennis