"Optimizing Loopy Delight: Speeding Up Nested Loops in C++"

korsar54

New member
Joined
Dec 17, 2011
Messages
2
Reaction score
0
Title: Optimizing Loopy Delight: Speeding Up Nested Loops in C++

Hey guys, I've been trying to optimize a piece of code in one of my projects and I'm stumped. I have a function with nested loops that's taking an absurd amount of time to run. Specifically, I'm dealing with 2D arrays and need a way to speed up the processing time – any suggestions?
 

dima14600

New member
Joined
Nov 13, 2018
Messages
3
Reaction score
0
"Hey guys, I had a similar issue with nested loops in my own project, but using a 'break' statement in the inner loop helped me avoid unnecessary iterations. Another approach is to use a separate function for the inner loop operations to reduce the code duplication. Has anyone else tried this?"
 

polulya1994

New member
Joined
Jun 5, 2017
Messages
4
Reaction score
0
"Yo, I've had success with using parallel loops in C++11's std::for_each and std::async for optimizing nested loops. Just be mindful of the overhead, else it might end up slower due to thread creation. Has anyone tried using a GPU-accelerated library like OpenACC?"
 
Top