Software tools for structuring complex program, Programming Languages

This assignment begins software tools and techniques for structuring complex programs. Use it to become familiar with these facilities, and ensure you use the speci?ed concepts in your assignment solution.

1. Run the following C++ program with and without preprocessor variable POSTFIX de?ned.

Compare the two versions of the program with respect to performance by doing the following:

Time the execution using the time command:

% time ./a.out

3.21u 0.02s 0:03.32 100.0%

(Output from time differs depending on your shell, but all provide user, system and real time.) Compare the user time (3.21u), which is the CPU time consumed solely by the execution of user code (versus system and real time).

Use the program command-line argument (if necessary) to adjust the number of times the experiment is performed to get execution times in the range 0.1 to 100 seconds. (Timing results in the range of .000001 to .01 seconds are inaccurate.) Use the same command-line value for all experiments.

Run both the experiments again after recompiling the programs with compiler optimization turned on (i.e., compiler ?ag -O2). Include all 4 timing results to validate your experiments.

Explain the relative differences in the timing results with respect to pre?x and post?x increment of a vector iterator.

Does compiler optimization affect either version? (Yes/No answer)

Give at least one URL from the web that disagrees with your conclusion