Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this exercise we show the definition of a web server log and examine code opt

ID: 3539048 • Letter: I

Question

In this exercise we show the definition of a web server log and examine code optimizations to improve log processing speed. The data structure for the log is defined as follows:


struct entry {

int srciP; // remote IP address

char URL[l 28]; // request URL (e.g . . "GET index.html")

long l ong refTime; // reference time

int status; // connection status

char browser[64]; // client browser name

} log [ NUM_ENTRIES];




A: topK_sourceIP ( int hour ) :

B: browser_histogr am ( int srcIP) : // browsers of a given IP


Which fields in a log entry will be accessed for the given log processing function? Assuming 64-byte cache blocks and no prefetching, how many cache misses per entry does the given function incur on average? need an answer for A and B

Explanation / Answer

a.connection status

B.64/8 = 4 B misses per entry

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote