Chapter3/comparison.cxx File Reference

Time 100,000 allocations of a table of 100 strings. Allocate 100,000 tables of char* strings and time the result. Used as a baseline for comparing against Comparison.java. More...

#include <iostream>
#include <stdio.h>
#include <sys/time.h>
#include "report.h"

Defines

#define MAX   100
 Size of the table of strings to be allocated.

Functions

char ** strings ()
 Allocate a table of MAX strings, each containing string 'george'.
int main ()
 Launch the application and time the performance.

Variables

static struct timeval before
 Time before process starts.
static struct timeval after
 Time after process completes.


Detailed Description

Time 100,000 allocations of a table of 100 strings. Allocate 100,000 tables of char* strings and time the result. Used as a baseline for comparing against Comparison.java.

Author:
George Heineman
Date:
6/15/08

Define Documentation

#define MAX   100

Size of the table of strings to be allocated.


Function Documentation

int main (  ) 

Launch the application and time the performance.

char** strings (  ) 

Allocate a table of MAX strings, each containing string 'george'.

Returns:
table of strings as char ** pointer.


Variable Documentation

struct timeval after [static]

Time after process completes.

struct timeval before [static]

Time before process starts.

Algorithm Development Kit 1.0