Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Hands On Lap 2

Performance Evaluation
Evaluating arrays . . .
-Make a table with the size of the array and the execution times for both
traversals.
-Is the execution time similar when you the matrix is traversed by rows
than when it is traversed by columns?

Yes the execution is similar ,the numbers even match a little .


-After evaluating the results, what can you extract from it? Is there any
change in the execution times for both traversals? How much does it
occupy 1 row? Why do you think it happens?
Evaluating with rows is shorter than evaluating with columns being the
difference almost x10 , this difference grows as the rows and columns do .
One row occupy the numbers of bytes equals the numbers of digits it has .
From my point of view this happens because each digit that is stored
measure 1 byte .
Access patterns and impact of the cache

Forma ijk (256) , milliseconds = 53.613000


(512), milliseconds = 462.699000
(1024), milliseconds= 3686.739000
FORMA jki (256), milliseconds = 55.891000
(512), milliseconds= 501.685000
(1024), milliseconds = 5266.194000
FORMA kij (256), milliseconds = 51.769000
(512), milliseconds= 624.320000
(1024), millideconds= 5014.969000

Memory hierarchy
Dynamic memory

The mem.c file contains a code that reserves an array of 10 characters


and initializes its positions. Then try to access positions outside of this
array.

-Run the code, observe the result and try to deduce what is happening.
As I run the code I can observe that it ca provide the positions of these 10
and can access other memory illegally
The mem2.c file shows the pernicious effects of using memory that we
have not explicitly reserved
- Run the code, observe the result and try to deduce what is happening.
Almost the same as the other code but in less steps because it doesn´t
have search more memory because is not defined .

You might also like