HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Const-me
MemoryAccessCosts
C++2018–2018
Const-me / MemoryAccessCosts

MemoryAccessCosts

Discover this repository through its Hacker News conversations.

2Distinct people
6Mentions
0Explicit recommenders
13GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week6 dated mentions

Observed mentions: 2018-08-02 00:06:03 UTC to 2018-09-19 13:44:31 UTC. Weeks start Monday, UTC.

0123452018-07-30 00:00:00 UTC to 2018-08-06 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 commentsJul 302018-08-06 00:00:00 UTC to 2018-08-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-08-13 00:00:00 UTC to 2018-08-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-08-20 00:00:00 UTC to 2018-08-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsAug 202018-08-27 00:00:00 UTC to 2018-09-03 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-09-03 00:00:00 UTC to 2018-09-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-09-10 00:00:00 UTC to 2018-09-17 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-09-17 00:00:00 UTC to 2018-09-24 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsSep 17

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jul 302018-07-30 00:00:00 UTC2018-08-06 00:00:00 UTC514
Aug 62018-08-06 00:00:00 UTC2018-08-13 00:00:00 UTC000
Aug 132018-08-13 00:00:00 UTC2018-08-20 00:00:00 UTC000
Aug 202018-08-20 00:00:00 UTC2018-08-27 00:00:00 UTC000
Aug 272018-08-27 00:00:00 UTC2018-09-03 00:00:00 UTC000
Sep 32018-09-03 00:00:00 UTC2018-09-10 00:00:00 UTC000
Sep 102018-09-10 00:00:00 UTC2018-09-17 00:00:00 UTC000
Sep 172018-09-17 00:00:00 UTC2018-09-24 00:00:00 UTC101

What Hacker News says

6 sources
> Right, and that’s GCC’s problems — MSVC-produced code is optimized, and is free from the described issue. > You know how I found that? I’ve made a version portable across compilers, built with VC++ and run on Windows: https://github.com/Const-me/MemoryAccessCosts I don’t have Intel compiler but my expectation is it’ll work even better. Yes! You have found that optimization doesn't allow you to make a comparison. Code is free of the described issue, so you cannot measure effect this issue have on the speed. As I understand from asm listings, you are comparing now not 1 iteration with 16 iteration, but 1 iteration with some vectorized code. In the original article this case is covered, with hand-crafted vectorized code. Do you see? When optimization is turned on you cannot compare 16 iterations with 1 iteration or with vectorized code. It
Read the rest
is the basics of experimental method: you need to control independant variable, and to measure dependant one. When using compiler optimizations it is the way harder, you would need to check generated code. Turn off vectorization of code in msvc, and hopefully you'll get the same results.
In Getting 4 bytes or a full cache line: same speed or not?
> Is it an obstacle to get one more free compiler? I have both gcc and clang installed but they’re for Linux. I’m using Windows as my main OS, and prefer running native binaries, e.g. because tools for debugging & profiling. > Its not relevant: this code do not rely on compiler optimizations. Right, and that’s GCC’s problems — MSVC-produced code is optimized, and is free from the described issue. You know how I found that? I’ve made a version portable across compilers, built with VC++ and run on Windows: https://github.com/Const-me/MemoryAccessCosts I don’t have Intel compiler but my expectation is it’ll work even better.
In Getting 4 bytes or a full cache line: same speed or not?
No it’s not that. The CPU runs fine, the OP was screwed up by GCC optimizer. With MSVC, there’s very small difference when testing with 8GB vectors, only 8% between 1 and 16. Here’s my portable version, scalar-only, C++, and slightly more optimized: https://github.com/Const-me/MemoryAccessCosts The results are in result-gcc.txt and result-msvc.txt in that repo. They’re from the same PC, I’m using gcc 5.4.0 running in WSL.
In Getting 4 bytes or a full cache line: same speed or not?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.