Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] Need help with understanding the results #1771

Open
evskola opened this issue Mar 20, 2024 · 1 comment
Open

[Q] Need help with understanding the results #1771

evskola opened this issue Mar 20, 2024 · 1 comment

Comments

@evskola
Copy link

evskola commented Mar 20, 2024

Hi there,

I did a benchmark for cv::cvtColor (in essense it loops through a set of images and does conversion BayerRG => BGR).

Run on (24 X 2112 MHz CPU s)
CPU Caches:
  L1 Data 48 KiB (x12)
  L1 Instruction 32 KiB (x12)
  L2 Unified 2048 KiB (x12)
  L3 Unified 30720 KiB (x1)
--------------------------------------------------------------------------
Benchmark                                Time             CPU   Iterations
--------------------------------------------------------------------------
BM_ConvertBayerRG8/threads:1        141345 ns       142299 ns         5600
BM_ConvertBayerRG8/threads:2        102112 ns       207203 ns         3318
BM_ConvertBayerRG8/threads:4        143496 ns       496779 ns         2988
BM_ConvertBayerRG8/threads:8        258000 ns       898438 ns          800
BM_ConvertBayerRG8EA/threads:1      169186 ns       174386 ns         4480
BM_ConvertBayerRG8EA/threads:2      129333 ns       204041 ns         3446
BM_ConvertBayerRG8EA/threads:4      175315 ns       592913 ns         2240
BM_ConvertBayerRG8EA/threads:8      287515 ns      1063756 ns          896
BM_ConvertBayerRG8VNG/threads:1   14805108 ns     14409722 ns           90
BM_ConvertBayerRG8VNG/threads:2   13547418 ns     26562500 ns           20
BM_ConvertBayerRG8VNG/threads:4    7017534 ns     25000000 ns           40
BM_ConvertBayerRG8VNG/threads:8    3459721 ns     20507813 ns           80

And BM_ConvertBayerRG8VNG results look weird to me. How it comes that running benchmark on 4, 8 threads gives lesser times than running on a single thread?

Images (2046*2046) are of 4mb in size (the result image is 12mb). The set in total is of 33 files.

@evskola evskola changed the title [Q] Need help with understanding results [Q] Need help with understanding the results Mar 20, 2024
@LebedevRI
Copy link
Collaborator

Because the time is divided by number of threads:

// Adjust real/manual time stats since they were reported per thread.
i.results.real_time_used /= b.threads();
i.results.manual_time_used /= b.threads();

This is a duplicate of #769 / #946. I'm not sure why the things the way they are,
and i don't know if they should be changed.

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

No branches or pull requests

2 participants