Exercise 00 - Execution Efficiency
Out: Wednesday January 3, 2018
Due: Friday January 5, 2018 by 11:15am.
- Fetch source file ex00.c, the "fully working"
implementation of a skeleton password cracker.
- Build an executable from the source code.
We will (mostly) be using C11 in this course, so:
gcc -std=c11 -Wall -g ex00.c -o ex00
- Run the executable you just created on attu using time (man time):
time ./ex00
Record the amount of CPU time required for execution.
- The previous steps built an executable with minimal code optimizations, resulting in machine code
similar to what you're taught in CSE 351.
Now rebuild the executable, this time enabling optimization level 3 (high optimization).
It is intended that you look up how to do this.
(We'd like to think you'll use man gcc, but we know you'll probably use google.)
- Run the optimized executable on attu and record the CPU time consumed.
- ex00.java begins an implementation of the same computation as ex00.c
but written in Java. Complete this implementation - don't dismantle what is there, just add whatever
is needed.
- Run your completed java implementation using time to detemine the CPU time consumed.
- Hand in to the course dropbox:
- a pdf file listing your name,
the three execution times you recorded, and
your best guess explanation for the relative sizes of those times. You don't need to spend more than five minutes
or so trying to figure out why the times are the way they are.
- your completed ex00.java program
(The following are generic requirements that will appear every exercise. Exactly how pertient
they are can vary from one exercise to another.)
Your code must:
- compile on attu without errors or warnings
- have no crashes, memory leaks, or memory errors
- be pretty: the code and its formatting, modularization, variable and
function names, and so on, must make us smile rather than cry.
- be robust: you should think about handling bogus input
from the user, and you should handle hard-to-handle cases
(if there are any) gracefully.
- have a comment at the top of your source file(s) with your name,
student number, and CSE or UW email address.