Wish: Variable Not Used Warning

Brad Roberts braddr at puremagic.com
Thu Jul 10 21:53:49 PDT 2008


Markus Koskimies wrote:
> On Fri, 11 Jul 2008 04:17:13 +0000, Markus Koskimies wrote:
> 
>> I'll read that later.
> 
> I read it. It's all about the well-known barrier between porcessors, 
> memories (RAM) and disks, and the necessarity of
> 
> (1) having mulit-level caches
> 
> (2) strive to the locality of execution
> 
> Nothing to do with D compiler, extra unused vars and performance. If you 
> really like to do cache optimization for modern PC, and not to trust to 
> compiler & runtime environment, you would need
> 
> (1) determine the cache hierarchy, sizes and the number of ways it has 
> (as well as indexing)
> 
> (2) write your code in assembler, and locate it at runtime so that it 
> fills the cache lines optimally
> 
> Certainly nothing to do with HLLs like D. Absolutely nothing.

Why is it that so many people here seem to have some sort of weird
blinders that turn the world into black and white with no shades of
grey?  The world just doesn't work like that.  Sorry to burst your bubble.

I'm glad it's well known to you, but it's completely foreign to others.
 It's very relevant information and that's why I posted the URL.
Additionally, your last sentence makes me think you're either being
willfully blind or just stubborn.

The cache latency and multi-processor interlocking on cache lines can be
a serious performance killer that is easy resolved with padding without
the need to dip into linker tricks and assembly.  Unfortunatly, tools
don't really exist to make it easy to discover these sorts of problems,
so just knowing that they can exist might help someone out there realize
a new avenue of thought at some point in their programming career.

Every modern x86 shares a cache line size these days.. 64 bytes.  That
one optimization alone can double the performance of a system that's
hitting cache line contention.  An awful lot of people aren't even aware
this sort of thing can occur.  Are you suggesting that it's not
something programmers should be aware of?

You're 'absolutely nothing' comment is wrong.  Every one of the examples
in that presentation are in C, and demonstrate quite clearly its
effects.  Can you do even better by going lower level, sure, but doesn't
make it worthless or nothing.

Later,
Brad



More information about the Digitalmars-d mailing list