What is Hackers' Pub?
Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed.


서버메이드 깐프 






しゅいろ





一般 Kyungmi Ahn ꉂꉂ(ᴖᗜᴖ*)
![19. You have a Sandy Bridge processor. You measure the memory latency and find that a read from memory takes 60ns. We have the following loop, where ITERS is some large number
for (size_t i = 0; i < ITERS; i += CACHE_LINE_SIZE) {
cnt += buf[i];
}
A. What parameters do we need to know to guess how long this loop will take to run (assuming everything is warmed up and/or we're observing some kind of steady state behavior) and what are the parameters? [answer at the end to avoid spoilers, feel free to skip to the end if you don't want to search up these parameters]
B. How fast does the loop run?
C. Without trying it out, how accurate do you think ChatGPT, Gemini, etc., are at answering this question?](https://files.mastodon.social/media_attachments/files/114/414/397/986/082/365/original/1280841fcfce4e60.png)


