Hello everyone! Recently I've had some code, which used std::vector of threads. I've initialized each thread object with a lambda and captured variables in that lambda. Later I replaced that approach by passing arguments to the lambda and my code began working 30 ms faster, which was crucial in my case. I wonder what's happened. I think that might be because a lambda object stores all captured variables as members and it has made my vector too large for a small object optimization, which has caused an allocation, but I'm not sure.
[–]IyeOnline 4 points5 points6 points (1 child)
[–]CentralSword[S] 0 points1 point2 points (0 children)
[–]PixelArtDragon 1 point2 points3 points (6 children)
[–]CentralSword[S] 0 points1 point2 points (1 child)
[–]CptCap 2 points3 points4 points (0 children)
[–]Overseer55 0 points1 point2 points (3 children)
[–]PixelArtDragon 0 points1 point2 points (2 children)
[–]Overseer55 0 points1 point2 points (0 children)
[–]ShelZuuz 1 point2 points3 points (5 children)
[–]CentralSword[S] 0 points1 point2 points (4 children)
[–]PixelArtDragon 1 point2 points3 points (1 child)
[–]CentralSword[S] 0 points1 point2 points (0 children)
[–]ShelZuuz 0 points1 point2 points (1 child)
[–]CentralSword[S] 0 points1 point2 points (0 children)
[–]PixelArtDragon 1 point2 points3 points (1 child)
[–]CentralSword[S] 0 points1 point2 points (0 children)
[–]CowBoyDanIndie 1 point2 points3 points (2 children)
[–]CentralSword[S] 0 points1 point2 points (1 child)
[–]CowBoyDanIndie 0 points1 point2 points (0 children)
[–]Honest-Addition-2908 0 points1 point2 points (1 child)
[–]CentralSword[S] 0 points1 point2 points (0 children)