#include <stdio.h>
#include "example_fcns.h"
#include "core24_structs.h"
#include "core24_cat.h"
const char *const description =
"Performance Test (inmemory): comparing transaction sizes";
#define NUM_RECORDS 50000
{
print_error (rc);
{
print_error (rc);
}
return rc;
}
unsigned int trans_size,
{
SIMPLE simple_rec = {0};
perfTimer_t timer;
unsigned int count = 0;
unsigned int ii;
printf (
"Add %d records with %-5d per transaction:\t", NUM_RECORDS, trans_size);
timeMeasureBegin (&timer);
for (ii = 0, count = 0; ii < NUM_RECORDS && rc ==
sOKAY; ii++)
{
if (count == 0)
{
print_error (rc);
}
{
simple_rec.int_col = 1;
hDB, TABLE_SIMPLE, &simple_rec, sizeof (simple_rec), NULL);
print_error (rc);
}
{
if (++count == trans_size)
{
print_error (rc);
count = 0;
}
}
}
timeMeasureEnd (&timer);
printf ("%u milliseconds\n", timeMeasureDiff (&timer));
return rc;
}
int main_core24 (int argc, const char *const *argv)
{
unsigned int trans_size[] = {50000, 10000, 5000, 1000, 500, 100};
print_error (rc);
{
rc = exampleOpenEmptyDatabaseInMemory (
&hTFS, &hDB, "core24", core24_cat);
{
for (
int ii = 0; rc ==
sOKAY && ii < RLEN (trans_size); ii++)
{
rc = delete_records (hDB);
{
rc = add_records (trans_size[ii], hDB);
}
}
exampleCleanup (hTFS, hDB);
}
}
return (int) rc;
}