5.18.1
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[128]; // request URL (e.g., “GET index.html”)
long long refTime; // reference time
int status; // connection status
char browser[64]; // client browser name
} log [NUM_ENTRIES];

Some processing functions on a log are:
a. topK_sourceIP (int hour);
b. browser_histogram (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?
 
 
View Solution
 
 
 
<< Back Next >>