Hacker News new | past | comments | ask | show | jobs | submit login

By far the most interesting part of this post is the update with newer compilers. Intel's compiler, in particular, makes an awesome optimization.

Edit: The update is not new, either. Just the part that I found interesting. Apologies for any confusion.




The update with the newer compilers was done back in 2012. There have only been minor changes since then. (Not to say that it isn't interesting, but so that people don't go to the post expecting new content and get disappointed)


I updated to make this clearer at the top level. Thanks!


Thanks for pointing that out. I'd seen this before so I wasn't going to bother clicking the link, not knowing there was a cool new thing there.


Glad it was worth clicking. I see I accidentally misled some folks that it was recently updated.


Yes, but checkout the Wikipedia page for Intel's C compiler. It points out that Intel's compiler selects optimum code if the CPU reports "GenuineIntel", but selects the least optimum code if the CPU is non-Intel. AMD sued Intel for this, and now Intel has a mumbo-jumbo disclaimer that it may not generate optimum code on a non-Intel CPU (without disclosing that it generates the least optimal code).


Can someone explain how interchanging the loops make it immune to mispredictions please? I don't get it


If I'm reading it right, the Intel compiler just took advantage of the outer test loop. It was supposed to loop over the data many times. Instead looped over each item of the data many times. Got the same answer, but the branch predictor had a much easier job.


Can you point those out please? I dont see any substantive edits in the last few years. Mostly just changing the notice, bounty award, and a roll back this year.


Updated my post. I merely meant the section. It was still old. :)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: