Wish: Variable Not Used Warning

Markus Koskimies markus at reaaliaika.net
Thu Jul 10 21:17:13 PDT 2008


On Thu, 10 Jul 2008 20:23:03 -0700, Brad Roberts wrote:

> Markus Koskimies wrote:
>> On Thu, 10 Jul 2008 21:09:26 +0000, BCS wrote:
>> 
>>> one cases where the extra vars might be added is as padding for cache
>>> effects.
>> 
>> ?!? You mean you use extra vars for making the cache to load the
>> correct one to a right cache line?
>> 
>> Sounds extremely silly to me!
> 
> For a good talk on just how important this can be, read the slides
> and/or watch the video here:
> 
>     http://www.nwcpp.org/Meetings/2007/09.html

I'll read that later.
 
> The memory latency and cache line behavior is covered towards the end.
> The entire talk is really really good.  Parts of it talk about another
> issue that's come up on these newsgroups more than once, instruction and
> memory ordering within concurrent applications.

Sorry to say to you, but;

1) the situation is different in embedded systems. In those systems you 
know the size of the cache, the number of ways it has and the amount of 
lines it stores.

And in those systems, you don't use compiler for optimize cache. You use 
linker to put the things to correct place.

2) For PC, IMO cache optimization is totally ridiculous. You really don't 
have any kind of glue in which kind of computer your code is being 
executed. If you optimize the cache usage for one special type of cache-
CPU -configuration, you have no idea how it performs in another 
configuration. I'll put all my €2 that the optimizations made for one's 
Windows Pentium-4 does really have no (good) effetcs on my Linux 64-bit.

If you're going to make cache optimizations, you'll need linker, and in 
PC world you need a system that does it automatically for you.



More information about the Digitalmars-d mailing list