News for hackers. Stuff that matters.
Re:How copying an int made my code 11 times faster by kccqzy on Sunday February 19, 2017 @10:25PM (#13684025)
How is this article related to branch prediction? I don't see any connection here.
Re:How copying an int made my code 11 times faster by nitinreddy88 on Sunday February 19, 2017 @10:32PM (#13684058)
I bet you didnt read the answer for that :)
Re:How copying an int made my code 11 times faster by Retr0spectrum on Sunday February 19, 2017 @11:49PM (#13684375)
I read it a while ago, and going on what I remember, I still can't see the connection. Would you mind explaining?
Re:How copying an int made my code 11 times faster by umanwizard on Monday February 20, 2017 @12:03AM (#13684426)
I don't think it's related to branch prediction in particular, just spooky action-at-a-distance where a change makes seemingly unrelated code much slower or faster.
Re:How copying an int made my code 11 times faster by alexeldeib on Monday February 20, 2017 @12:39AM (#13684599)
What makes you say this? The author provides an extremely persuasive case, with perf timings. Additionally updated it with compiler enhancements from GCC and Intel that remove the branch mispredictions entirely and do perform as predicted.
Re:How copying an int made my code 11 times faster by umanwizard on Monday February 20, 2017 @05:08AM (#13686026)
I think you misunderstood me. I agree that the StackOverflow post has to do with branch prediction. I just meant that I don't think that's why the earlier poster thinks it's parallel to the situation described in the article.
Re:How copying an int made my code 11 times faster by alexeldeib on Monday February 20, 2017 @07:29PM (#13692247)
Ah, my mistake. I thought the OP a bit further up didn't understand the relation of the stack overflow answer to the array question.