Beginner programmer: flat array using std::vector Intermediate programmer: complex data structure using custom templates containers and allocators Expert programmer: flat array using malloc.
-
-
Replying to @maxliani @Peter_shirley and
Stick with std::vector. The bugs are worked out.
1 reply 0 retweets 3 likes -
I'm sticking to std::vector until the profiler tells me not to.
4 replies 0 retweets 8 likes -
Replying to @stefan_3d @isonno and
Depending on the platform, std::vector doesn’t even implement bounds checking asserts... you cannot safely have one in your public API... and the profiler may not easily reveal where the problem comes to data/noise ratio in cache lines (std::vector is 1/3 ratio)
2 replies 0 retweets 3 likes -
-
Replying to @Reedbeta @stefan_3d and
Say you have your data structure (i.e. a scene object) where you have a bunch of fields as std containers (I.e. points, indices, normals...), all of your pointers to access data are interleaved with data you may actually never need, such as the buffer capacity.
2 replies 0 retweets 0 likes -
In the middle of your algorithm you may end up pulling multiple cache lines, just to access your buffers instead of just one.
2 replies 0 retweets 0 likes -
Maybe I'm misunderstanding you - are you talking about SOA vs AOS?
1 reply 0 retweets 0 likes -
Replying to @stefan_3d @maxliani and
No, he's talking about the fact that std::vector does not let you control how the pointer and count are determined and where they are stored, which are two things you absolutely care about if you care about performance.
2 replies 0 retweets 3 likes -
Replying to @cmuratori @maxliani and
A thanks, yes. It was obvious in the tweet, I just hadn't had my coffee yet.
1 reply 0 retweets 1 like
No problem. Friends don't let friends use std :)
-
-
Replying to @cmuratori @maxliani and
Thanks for taking the time. I was aware of the fundamentals, but didn't realize how putting it together could become an actual issue. I'm tempted to try it in Cycles and see if there's a measurable difference if I kick the size member variable out of our array data structures.
1 reply 0 retweets 1 like -
Replying to @stefan_3d @cmuratori and
Didn't do anything performance wise. Turns out it never reads from it at all during path tracing.
0 replies 0 retweets 0 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.