Skip to content

Implementations instrumentation framework for OpenCV performance test system; - #7101

Merged
opencv-pushbot merged 1 commit into
opencv:masterfrom
lupustr3:pvlasov/instrumentation
Aug 18, 2016
Merged

opencv-pushbot merged 1 commit into
opencv:masterfrom
lupustr3:pvlasov/instrumentation

Conversation

@lupustr3

Copy link
Copy Markdown

This pullrequest changes

Instrumentation framework for OpenCV performance test system. It was developed to:

  • track implementations execution inside OpenCV functions with call tree output to test logs
  • track implementations execution time weight in the pipeline

Framework can be enabled with ENABLE_INSTRUMENTATION define in CMake and disabled by default. In disabled state it doesn't consume resources.

Example instrumentation was implemented for cv::meanStdDev function:

Output example for IPP:

[ RUN      ] Size_MatType_meanStdDev.meanStdDev/6
[ PERFSTAT ]    (samples = 25, mean = 0.10, median = 0.10, stddev = 0.00 (0.5%))
[ VALUE    ]    (1920x1080, 8UC1)
[ TRACE    ]
ROOT
\---cv::meanStdDev - C:25 /*entries counter*/ T:2.3906ms /*block execution time*/
    \---cv::ipp_meanStdDev<W_IPP> - C:25 T:2.3269ms L:97% /*weight in local block*/ G:97% /*weight in entire pipeline*/
        \---ippiMean_StdDev_C1R<F_IPP> - C:25 T:2.2700ms L:98% G:95%

IPP weight: 95.0% /*total implementation functions execution weight across all entries*/
OPENCL weight: 0.0%
[/TRACE    ]
[       OK ] Size_MatType_meanStdDev.meanStdDev/6 (77 ms)

Output example for OpenCL:

[ RUN      ] OCL_MeanStdDevFixture_MeanStdDev.MeanStdDev/7
[ PERFSTAT ]    (samples = 25, mean = 0.23, median = 0.23, stddev = 0.00 (1.8%))
[ VALUE    ]    (1280x720, 32FC1)
[ TRACE    ]
ROOT
\---cv::meanStdDev - C:25 T:5.8007ms
    \---cv::ocl_meanStdDev<W_OCL> - C:25 T:5.7412ms L:99% G:99%
        \---k.run<F_OCL> - C:25 T:3.5630ms L:62% G:61%

IPP weight: 0.0%
OPENCL weight: 61.4%
[/TRACE    ]
[       OK ] OCL_MeanStdDevFixture_MeanStdDev.MeanStdDev/7 (36 ms)

@lupustr3
lupustr3 force-pushed the pvlasov/instrumentation branch from 183195c to 19811a7 Compare August 12, 2016 07:05
@alalek

alalek commented Aug 12, 2016

Copy link
Copy Markdown
Member

Awesome useful feature!

Comment thread modules/ts/src/ts_perf.cpp Outdated
}
}

static double calcLocWeight(cv::instr::InstrNode *pNode)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calcLocWeight -> calcLocalWeight ?

Same note for calcGlobWeight -> calcGlobalWeight

@lupustr3
lupustr3 force-pushed the pvlasov/instrumentation branch 2 times, most recently from 380e544 to 7a80926 Compare August 12, 2016 12:08
@lupustr3

Copy link
Copy Markdown
Author

"--perf_instrument" command line switch was added to ps

@lupustr3
lupustr3 force-pushed the pvlasov/instrumentation branch 2 times, most recently from 950dc9e to f689b9c Compare August 16, 2016 06:43
Comment thread modules/core/src/system.cpp Outdated
Node<OBJECT>::Node()
{
m_pParent = 0;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, implementation of template classes should be placed in headers (.hpp or .impl.hpp)

@lupustr3
lupustr3 force-pushed the pvlasov/instrumentation branch from f689b9c to 2a4efec Compare August 16, 2016 14:32
@lupustr3

Copy link
Copy Markdown
Author
  • Parallel regions handling was redesigned and improved.
  • Total time accumulators were replaced with running mean time accumulators to decrease overhead of threads timing synchronization in parallel regions
  • Changes according to notes above.

@alalek

alalek commented Aug 16, 2016

Copy link
Copy Markdown
Member

Great update! Looks good.

BTW, What do you think about these macro changes? Are there any expected problems?

@lupustr3

lupustr3 commented Aug 17, 2016 •

Copy link
Copy Markdown
Author

I think it should work the same.

Do you want me to integrate these changes into my commit?

@lupustr3
lupustr3 force-pushed the pvlasov/instrumentation branch from 2a4efec to 9fec107 Compare August 17, 2016 13:22
@lupustr3

Copy link
Copy Markdown
Author

New macro interface

@lupustr3
lupustr3 force-pushed the pvlasov/instrumentation branch from 9fec107 to a462d76 Compare August 17, 2016 13:26
@alalek

alalek commented Aug 18, 2016

Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants