Referring to array element by descriptive name

Era Scarecrow via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 16 11:13:03 PST 2017


On Monday, 16 January 2017 at 19:03:17 UTC, albert-j wrote:
> Thank you for all your answers. I was concerned because I'm 
> dealing with a small function that is called many times and 
> where the bulk of the calculations in the simulation takes 
> place. So even 5% performance difference would be significant 
> for me. But it is good to know that compilers are smart enough 
> to optimize this.

  A while ago I had to deal with that fact, that the optimizations 
that it does over several levels is often better than my own. 
Using shifts which obfuscates that I was actually doing a divide. 
I tried writing a unique array handler to shave a few operations 
and save time, only to get no real benefit from it.


More information about the Digitalmars-d-learn mailing list