Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice introduction to data prefetching. I don't fully agree with this statement, though:

Second, programmers have very little control over instruction placement in memory.

Depending on your platform and type of application you may have full control over instruction placement and it might be extremely important to know how to sequence instructions to get maximum performance.



It's certainly possible to have that control via assembler, where folks are programming in that. So strictly speaking, yes, your "may" can be true.

For C or another language, here's some related reading on that topic, and where you can get into deep trouble with this:

http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/pldi05... http://www.hpl.hp.com/personal/Hans_Boehm/misc_slides/reorde... http://www.hpl.hp.com/techreports/2005/HPL-2005-217R1.pdf http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf


Assuming he is talking about languages like C, and you don't use inline assembly, I don't see how you can have any control. For anything complex, your compiler will probably do a much better job then you in creating fast assembly.In the case you can do better, you would just inline the code, so you only have control over that small part.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: