I write in C++ almost every day but never have the need to optimize for speed. Even when you write straightforward code it's already blazingly fast.
True, but moving from a list of unique polymorphic pointers to a std::variant gains you at least a 2-3x speed up in terms of TLB and cacheline locality. From there, swapping to SOA will net you another 4-8x, so you're looking at nearly 25x improvement by going data first. That may not matter in the unique case of say, games, where rendering a million entities will dwarf the cost of SIMD processing a million entities, but in something like numerical simulations (fluids) or quant it will be warmly welcomed
hn_submit · · focus · HN ↗
glouwbug · · focus · HN ↗
jplusequalt · · focus · HN ↗
Modern graphics APIs allow you to render as many objects as you want with a single draw indirect call.