Skip to content

RizeComputerScience/COMPSXII-Architecture-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Architecture Analysis Starter Code

What This Program Does

This benchmark measures how long it takes to access data at different array sizes. When data fits in your CPU's cache, access is fast. When data exceeds cache size, the CPU must fetch from slower memory levels.

By watching where access times jump, you can identify your CPU's cache boundaries.

How to Run

Windows (using MinGW or WSL)

gcc -O2 architecture_analysis.c -o arch_analysis
./arch_analysis

Mac

gcc -O2 architecture_analysis.c -o arch_analysis
./arch_analysis

Linux

gcc -O2 architecture_analysis.c -o arch_analysis
./arch_analysis

Expected Output

The program will test array sizes from 4 KB to 64 MB and print access times in nanoseconds. Look for lines marked with <-- JUMP indicating a significant increase in access time.

Example output:

Array Size   Elements        Avg Access Time (ns)
----------   --------        --------------------
4 KB         1024            0.85
8 KB         2048            0.87
16 KB        4096            0.86
32 KB        8192            0.91
64 KB        16384           1.42 <-- JUMP
128 KB       32768           1.45
256 KB       65536           1.89 <-- JUMP
...

Troubleshooting

"gcc not found": Install gcc using your system's package manager or download MinGW (Windows).

Program runs too long: The benchmark takes 1-2 minutes to complete. Be patient.

No jumps visible: Your CPU's cache may be large enough that the test sizes don't exceed it, or the system is under heavy load. Close other applications and try again.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages