Creator of LLVM, Clang, and Swift Says To Not Write Security Critical Code In C/C++

via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 15 02:36:00 PDT 2015


On Wednesday, 15 July 2015 at 08:32:19 UTC, Kagamin wrote:
> On Wednesday, 15 July 2015 at 00:28:47 UTC, Ola Fosheim Grøstad 
> wrote:
>> I am happy if I see that I have consistent 20% headroom, and I 
>> am not going to be happier by making my program faster...
>
> But then why optimizations would matter? If the program is 
> fast, you won't improve it by improving performance by 2 times: 
> it will remain fast, and if it's slow, it's probably an 
> algorithmic complexity.

Ability to optimize later matters because I need to keep the 
deadline, or else the real time thread will be killed by the OS. 
If I miss the deadline occasionally, maybe I only need 10% 
improvement.

I have many options. I can reduce fidelity in an audio 
application. I can put more work into integrating two loops into 
one loop and keep values in SIMD registers based on the number of 
SIMD register the particular CPU supports etc...

What I don't want to do is restructure the entire dataset, so I 
put more work into memory layout than the initial loop. If the 
loop completes in time I'm good, if not, I put more work into it 
(or reluctantly reduce fidelity).

> You said it yourself that to get performance from C you need 
> extensions, it's not provided by C semantics itself.

No? I said I write "cpu independent simd" in my core performance 
oriented loop as a starting point. Whether I need to do that is 
debatable... but it ensures that data structures are designed to 
be simd friendly from the start.



More information about the Digitalmars-d mailing list