pipelining in C++

Joined
Oct 9, 2009
Messages
9
Reaction score
0
* Hi All
I read a lot of times that pipelining is a good trick to optimize and speed up your code.

I alway read basically to perform operations instead of this way

Operation_1_a;
Operation_2_a;
Operation_3_a;

Operation_1_b;
Operation_2_b;
Operation_3_b;

Operation_1_C;
Operation_2_C;
Operation_3_C;


I 'd better to do this

Operation_1_a;Operation_1_b;Operation_1_c;
Operation_2_a;Operation_2_b;Operation_2_c;
Operation_3_a;Operation_3_b;Operation_3_c;

where I can profit of the code that is already in the cache.

Do you have a sample code where I can better see this concept already in practice or some hint?

My guess that the real precondition for this technique is that Operation_1, Operation_2 and Operation_3 must be totally uncorrelated each other i.e. the result of one must not depend on the call of the previous function so no shared state or sharing variables.
Am I right?
Mn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top