F
FutureChips
futurechips.org · Personal blog · on HN since 2011
FutureChips covers computer architecture and performance for programmers, including prefetching, parallel programming, Amdahl's law and code that compilers handle badly.
What HN saysHN discusses its posts on C performance and hardware prefetching; one commenter flagged a submission as spam, and another said the author speculated beyond what he knew.
15HN people shared it
3linked it in comments
34stories submitted
237story points
10 years agolast shared
2011people per year2026
Most-shared posts
- 1How to trick C/C++ compilers into generating terrible code?4 people · 66 points · first shared 2011 · 18 comments on HN
- 2Should you ever use Linked-Lists?3 people · 4 points · first shared 2011 · 1 comments on HN
- 3What programmers need to know about hardware prefetching?2 people · 49 points · first shared 2011 · 7 comments on HN
- 4Parallel Programming: Understanding the impact of Critical Sections2 people · 12 points · first shared 2011 · 1 comments on HN
- 5Computer Science Self-assessment Quiz (+answers)1 people · 23 points · first shared 2011 · 11 comments on HN
- 6Discussion: Aren't loops the only interesting code?1 people · 14 points · first shared 2011 · 8 comments on HN
- 7Parallel Programming: Amdahl’s Law or Gustafson’s Law1 people · 13 points · first shared 2011 · discussion on HN
- 8Why Amdahl's law is often used incorrectly?1 people · 7 points · first shared 2011 · 1 comments on HN
- 9Quiz: How well do you know CPUs/Microprocessors?1 people · 7 points · first shared 2011 · 6 comments on HN
- 10What’s Wrong With GNU make?1 people · 6 points · first shared 2011 · 1 comments on HN
- 11Amazingly sparse (stupid) code snippet .. LOL1 people · 4 points · first shared 2011 · discussion on HN
- 12DRAM explained to programmers1 people · 3 points · first shared 2011 · discussion on HN
- 13Why the K-computer is the fastest and energy-efficient?1 people · 3 points · first shared 2011 · 2 comments on HN
- 14Which little PC to buy? Quick comparison of Raspberry Pi & more1 people · 3 points · first shared 2012 · discussion on HN
- 15Lesson learned when creating an iOS6 Pass generator1 people · 3 points · first shared 2012 · 8 comments on HN
What HN people wrote when they linked it
gurkendoktor · 2012-06-11
I think the most dangerous part of C is that many people assume C is perfectly efficient. It's as if C was the "100%" of performance and other languages are converging towards it as they get better.
But I don't see how this is true. Pointer aliasing is the biggest example probably:
http://www.futurechips.org/tips-for-power-coders/how-to-trick-cc-compi…
And then there is the huge abstraction penalty for things like `qsort()` where C++ is actually way ahead of C.
profquail · 2011-09-16
I'm usually the first to upvote well-written GPGPU articles, but I'm flagging this as spam. See:
http://news.ycombinator.com/submitted?id=iliastsagklis
http://news.ycombinator.com/submitted?id=kioub
http://news.ycombinator.com/submitted?id=javacodegeeks
Not to mention, it's a direct copy of this post (which they've credited; but still it smells like spam): http://www.futurechips.org/chip-design-for-all/cpu-vs-gpgpu.html
jacquesm · 2012-05-04
> I'm not familiar with the internals of the prefetcher of any CPU at this level
So better not speculate, what you think could be done when you are not familiar with the details typically tends to be a lot harder when you are familiar with the details and are tasked with the implementation. The devil is in the details and there is a very appreciable gap between theory and practice.
Further reading: http://www.futurechips.org/chip-design-for-all/prefetching.html
Note the caution against using lists and trees and an advice to stick to arrays, which are typically accessed sequentially.
> Btw. you can add prefetch instructions in your code manually if you do linked list traversals or similar. In GCC you can use __builtin_prefetch() compiler intrinsic.
And that is exactly the point, if you don't supply the knowledge neither the processor nor the compiler can do this for you. If the processor or the compiler could do this then those __builtin_prefetch calls would not be required.