CUBoulder-HPCPerfAnalysis / memory

Experiments with memory performance
MIT License
2 stars 7 forks source link

Reverse Memory Access #9

Closed engvall closed 9 years ago

engvall commented 9 years ago

Tested the effects of reverse access to memory on both an i5 and i7 processor.

jedbrown commented 9 years ago

What compiler and flags are you using? Interestingly, both forward and reverse Copy compiles to a memcpy call using gcc-4.9 and -O3 -march=native.

engvall commented 9 years ago

I'm using gcc 4.2.1 with flags -O3 and -march=native. Am I understanding correctly that if I compiled with gcc-4.9, I wouldn't see the marked change in performance for the Copy test?

jedbrown commented 9 years ago

I see it at -O3, but not at -O2. But if both are calling memcpy, we're not testing forward and reverse traversal. There was a time where reverse memcpy was faster than forward for sizes that fit in cache. This broke Flash and a few other buggy programs.

http://lwn.net/Articles/414467/ https://sourceware.org/bugzilla/show_bug.cgi?id=12518

engvall commented 9 years ago

I don't have too much experience with assembly, but it doesn't look like its calling memcpy (using version 4.2.1)