Runtime vs. Compile time

前端 未结 27 932
后悔当初
后悔当初 2020-11-22 06:50

What is the difference between run-time and compile-time?

27条回答
  •  感情败类
    2020-11-22 07:15

    I have always thought of it relative to program processing overhead and how it affects preformance as previously stated. A simple example would be, either defining the absolute memory required for my object in code or not.

    A defined boolean takes x memory this is then in the compiled program and cannot be changed. When the program runs it knows exactly how much memory to allocate for x.

    On the other hand if I just define a generic object type (i.e. kind of a undefined place holder or maybe a pointer to some giant blob) the actual memory required for my object is not known until the program is run and I assign something to it, thus it then must be evaluated and memory allocation, etc. will be then handled dynamically at run time (more run time overhead).

    How it is dynamically handled would then depend on the language, the compiler, the OS, your code, etc.

    On that note however it would really depends on the context in which you are using run time vs compile time.

提交回复
热议问题