3 ms·
Why does it blow for you? If the compiler can do it automatically, that seems very useful. Or is it doing it suboptimally? (Say you want two fields in the same
by Ded7xSEoPKYNsDd 12y ago
Why does it blow for you? If the compiler can do it automatically, that seems very useful.
Or is it doing it suboptimally? (Say you want two fields in the same cache line, but the compiler sorts them away.)
- devbug 12y agoI know better than the compiler how my data is used. It is really simple as that. I can optimize with the totality of the program in mind while the compiler optimizes on heuristic like `order largest to smallest`. So yes, the compiler is doing it sub-optimally. Not to mention the repetitious hell it creates when writing C bindings, or memory-mapping structures, and so on and so forth. In the end, however, my reservations are mostly due to a "get off my lawn" mentality.
- spiritplumber 12y agoAre you Mel Kaye?
- devbug 12y agoHah! Only when the difference in performance is end-user discernible. I do make sure the code is well crafted in those bounds though. There's no _valid_ excuse for crafting ugly code. Coincidently my stuffed toy that I have kept throughout my childhood was named "Mel the Pal." I just noticed the irony of that. :)
- banachtarski 12y agoThe compiler can't know exactly how I intend the data to be read or written to at runtime. You generally don't want to read and write to the same cache line at a time.