/g/ - Technology

install openbsd

[Make a Post]
[X]





Superoptimization Nanonymous No.1104 [D][U][F][S][L][A][C] >>1107 >>3743 >>3745
File: b0db28fe625caefa1f51add01565b5d593aa7af51715b6d16cb033f94fa9a6ee.png (dl) (373.23 KiB)

How do I get started with superoptimization /g/? I hear it's this magic way to make (very short) pieces of code as fast as possible by trying huge numbers of instructions. Is it actually useful or is it just a meme? For example, if I wanted to superoptimize a strlen() function, how long would it take?

Nanonymous No.1107 [D]

>>1104
write your code in assembly.
after youre done you will realize you wasted your time

Nanonymous No.1122 [D]

Sounds retarded. Just profile your code.

Nanonymous No.1136 [D]

actually optimize any concrete program first
>if I wanted to superoptimize a strlen() function, how long would it take?
what the fuck does that mean, superoptimizaiton is a general compliation technique. do you mean how long will it take to compile it?

Nanonymous No.3743 [D] >>3744

>>1104
Pigchan bait thread. mod plz remove

Nanonymous No.3744 [D]

>>3743
It was dead until you bumped it retard. learn how to sage.

Nanonymous No.3745 [D]

>>1104
I tried a few superoptimizers. Most of them didn't compile, many of those that did segfaulted, those that didn't segfault generated code that doesn't do what I told it to.
tl;dr it's a gay meme

Nanonymous No.3747 [D] >>3766

>(very short) pieces of code
>huge numbers of instructions
The fuck?
Anyway optimizing is a complicated topic.
"Huge number of instructions" may mean, for example, loop unrolling or something.
Also if you're going to write for (((x86))), you have to follow their documentation for maximum optimal code.

Nanonymous No.3766 [D] >>3771 >>3785

>>3747
>implying that is documented
<inb4 link to some shitty intel manual

Nanonymous No.3770 [D] >>3771

I literally saged it you bloody retard. YOUR GODDAMN POST was the one that bumped it. Lrn2sage newfag

Nanonymous No.3771 [D]

>>3766
Intel does offer at least some information on how quickly some instruction performs.
Too bad it's stingy.

>>3770
You got "mailto:sage" in your email field fren. Not just "sage". No way in hell it sages.