CUFCTL / face-recognition

A GPU-accelerated real-time face recognition system based on classical machine learning algorithms
MIT License
23 stars 11 forks source link

Time profiling for PCA, LDA, and ICA #5

Closed bentsherman closed 7 years ago

bentsherman commented 8 years ago

As each algorithm becomes functionally correct in the C code, we should do some profiling so that we can analyze the code for bottlenecks and eventually have a way to measure performance.

For now we can do this by measuring the time before and after the code in question and print the difference:

clock_t start, end;

start = clock();
// ...
end = clock();

printf("time to do [task]: %g s\n", 1000.0 * (end - start) / CLOCKS_PER_SEC);

The timing code should be controlled by a command line argument, something like --timing.

Later on we might be able to find better ways to manage the timing code. For example, I would like to store all timing information in a structure so that all of it can be printed at the end instead of throughout the code.

arlindohall commented 7 years ago

A timing library will soon be added in the lda-timing branch, which can be pulled into master. The problem with g++ linking was solved by continuing to use gcc as the c compiler, with g++ used for *.cpp files, and the addition of -lstdc++ to the LFLAGS variable, which includes the library definitions for c++ types.

arlindohall commented 7 years ago

lda-timing has been merged into master