CS 330: Algorithms: Design & Practice

Homework6: Performance Evaluation
Due: In class on Thursday, March 6, 2008

Presentation By: Marwa & Joe

Section 7.2 and Appendix 3 of Bentley's text discusses measuring performance of a given language and a computer (e.g. running C programs on a specific computer hardware). In this exercise you will do a comparison of C, C++, and Python implementations on the same computer. Here are the questions you will need to answer:

1) What is the speed of your computer?

For C, C++, and Python, answer the following for this computer:

2) How many integer additions can you perform in one second?
3) How many floating point additions?
4) How many integer multiplications?
5) How many floating point multiplications?
6) How many integer divisions?
7) How many floating point divisions?

Write programs in all three languages and collect data. Be careful to exclude timing of any overheads involved (like loop increments, termination checks etc.). Write a formal report that uses the data obtained to compare the performance of your computer, and the relative performance of the same operations in the three programming languages.

You are free to write any programs and use as many tools as you wish to do the above data collection and analysis.

EXtra Credit: Include data about another programming language in your report.

What to hand in:

A report as described above.

Marwa & Joe will give presentations on this project.


Back to CS330 Materials