IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 30, 2005, 6:32:45 PM (21 years ago)
Author:
eugene
Message:

first pass on testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMerge.c

    r5860 r5862  
    1 # include "ppImage.h"
     1# include "ppMerge.h"
    22
    33int main (int argc, char **argv) {
     
    66    ppConfig config;
    77    ppOptions options;
     8
    89
    910    psTimerStart("merge");
     
    1516    // Get camera configuration from header if not already defined
    1617    // Construct camera in preparation for reading
    17     ppMergeParseCamera (&data, &config, argv);
     18    ppMergeParseCamera (&data, &config);
    1819
    1920    // Set various tasks (define optional operations)
     
    2728
    2829    // output options
    29     // ppImageOutput (&data, &options, &config);
     30    ppMergeOutput (&data, &options, &config);
    3031
    3132    exit (0);
    3233}
     34
     35int speedTest (void)
     36{
     37    # define NTEST 10000000
     38    psStats *testData, *stats;
     39    stats = psStatsAlloc (PS_STAT_ROBUST_MEAN);
     40    psList *testList = psListAlloc (NULL);
     41    psArray *testArray = psArrayAlloc (NTEST);
     42
     43    psTimerStart("merge");
     44    for (int i = 0; i < NTEST; i++) {
     45        testArray->data[i] = stats;
     46    }
     47    fprintf (stderr, "added %d objects to array: %f usec / obj\n", NTEST, 1e6*psTimerMark ("merge")/NTEST);
     48
     49    psTimerStart("merge");
     50    for (int i = 0; i < NTEST; i++) {
     51        psListAdd (testList, PS_LIST_TAIL, stats);
     52    }
     53    fprintf (stderr, "added %d objects to list: %f usec / obj\n", NTEST, 1e6*psTimerMark ("merge")/NTEST);
     54
     55    psTimerStart("merge");
     56    for (int i = 0; i < NTEST; i++) {
     57        testData = testArray->data[i];
     58    }
     59    fprintf (stderr, "pulled %d objects from array: %f usec / obj\n", NTEST, 1e6*psTimerMark ("merge")/NTEST);
     60
     61    psTimerStart("merge");
     62    psListElem *tmpInput = (psListElem *) testList->head;
     63    while (tmpInput != NULL) {
     64        testData = tmpInput->data;
     65        tmpInput = tmpInput->next;
     66    }
     67    fprintf (stderr, "pulled %d objects from list: %f usec / obj\n", NTEST, 1e6*psTimerMark ("merge")/NTEST);
     68
     69    exit (0);
     70}
Note: See TracChangeset for help on using the changeset viewer.