Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-120121-

Branch Misses

Name: Anonymous 2011-09-26 17:26

How bad do branch misses hurt a programs performance? In C and Java?

for example how big of an impact would :


int shitinanus()
{
    int val = getanus();
    if(val != 0)
        return ANALTONIGHT;
    return ALONETONIGHT;
}


be knowing that val will most likely be 0 99% of the time compared to the below function


int shitinanus()
{
    int val = getanus();
    if(val == 0)
        return ALONETONIGHT;
    return ANALTONIGHT;
}

Name: Anonymous 2011-09-26 17:57

Shouldn't make any difference because the compiler would optimize the branch away.

Name: Anonymous 2011-09-26 18:46

Surely you could have taken the five minutes to actually benchmark that code. I suspect you just wanted to shit up /prog/ with your puerility.

Ah, well. With a bit of luck, you would find that in your example it doesn't make a lick of a difference, due to one of two factors:
1. Any modern CPU keeps a history buffer with taken branches, so no matter how you organize your code, it will predict a branch to the common case for frequently executed branches.
2. If you don't have a modern CPU, i.e., one with OoOE, your example should compile to a conditional move, eliminating the branch altogether.

To give some actual numbers: the branch misprediction penalty on a Cortex-A8 is 13 cycles, and on a Cortex-A9 it's 8 cycles.
I found some interesting data on other processors at http://www.7-cpu.com/ , though I can't vouch for its accuracy.

Name: Anonymous 2011-09-26 18:57

>>1
Theoretically, branching is prejudicial to performance in general, because it tends to force pipeline flushes or stalls. The predicting circuitry avoid great part of the penalty. Thus, a branch miss hits performance somewhat bad in the machine-level, but not as bad as a cache miss (except, evidently, if the branch miss also causes an instruction cache miss).

This means that you'll have visible performance differences in certain situations; for example, if you're branching dozens of thousands of times in a tight loop. Otherwise, it won't even contribute to the execution time noise; such latencies are typically in the nanosecond range. Also, depending on the final code layout, the static predictor always hits if certain conditions are met (for example, conditional backwards jumps are always seen as taken). In C, you can't decide the code layout, except by hinting the compiler with builtin directives (which he'll probably ignore anyway, since programmers are very bad at predicting bottlenecks).

Thus, "branch misses" are a concern far, far, far away from the average application code, specially in the kind of conditional you've suggested in the snippet. In Java (and probably every language which is not C), it's even more true: Java has an ocean of low-level overhead between source code and the final instruction stream, making any attempt of justifying some "optimized" construct look just plain ridiculous.

Also, x86 processors have an optimization circuitry called "loop stream detector" which is able to optimize very heavily the execution of small loops up to 16 bytes in code length. (Remember that a loop always have a conditional branch associated with it.)

Ultimately, people who're paranoid about such issues rarely understand anything about the subject. They typically have bad programming practices (like littering the code with __builtin_expect() directives), kludges data structures with "optimized" expressions, and overinline function calls, causing an even greater performance loss (due to the forementioned and imminent instruction cache miss caused by big thunks of linear code). People don't profile, because profiling makes you look uncool, since it always proves that all of "those highly and expertly optimized sites in your C code" is just girlyish bullshit.

IOW: don't waste energy "optimizing" branch sites in Java. In C, it'll make sense only in very specific scenarios, with which you'll probably never meet.

Name: Anonymous 2011-09-26 19:14

why dont you compile each and run them 9 billion times each and compare

Name: Anonymous 2011-09-26 19:20

ONE WORD: THE FORCED PROFILE-GUIDED OPTIMIZATION OF THE CODE

THREAD OVER


>>3
http://www.7-cpu.com/
Cortex-A9

Whoah, I didn't expect toy CPUs to perform that well. OTOH at these low frequencies relative RAM latency is much lower and this benchmark is highly dependent on that, but still it's kinda impressive to have a CPU which can compete with x86 in IPC for once. Now they just need to put 12 cores in and bump the clock threefold.

Name: Anonymous 2011-09-26 19:21

>>3
Surely you could have taken the five minutes to actually benchmark that code. I suspect you just wanted to shit up /prog/ with your puerility.
what a faggot you sound like

Name: Anonymous 2011-09-26 19:26

>>4
Not OP, but this post was highly informative. If you could give a good source in which I can read about the subject to help me with my girlish optimization fantasies I would be thankful.

Name: Anonymous 2011-09-26 19:44

>>8
There's only one reliable source regarding assembly-level code optimization: the processor manuals. Everything else is either bullshit, or just resaying what the manuals already say.

Intel has a book dedicated to that subject, for IA-32: http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html. It's a very interesting book, albeit the reading is rather deep.

But it'll probably be of more use if you look for profiling techniques. Search for oprofile and gprof for a starting point. These tools are typically enough to detect real bottlenecks on profilable code.

Name: Anonymous 2011-09-26 19:47

>>9
Thank you.

Name: Anonymous 2011-09-26 19:52

>>9
The processor manuals don't always tell the whole story in an useful way.

http://www.agner.org/optimize/ is required reading, specially as far as x86 is concerned.

Name: Anonymous 2011-09-26 19:59

>>11
That is the greatest thing I've seen on the internet for some time now. Its like walking in on a treasure trove.

Name: Anonymous 2011-09-26 20:00

!=0 should still be the faster option..?

Name: Anonymous 2011-09-26 20:01

>>6
According to ARM's figures, the Cortex-A15 will have increased IPC, goes up to 2.5 GHz, and is designed for quad-core.
So far, so good, but if they want the desktop and server market they'll have to introduce a 64-bit architecture. LPAE is just a stopgap measure.

Name: Anonymous 2011-09-26 21:31

>>4
Okay, I can't tell if you're just plain fucking stupid, a jew, trolling, or any combination of the three. Anyways, from the view of the C abstract machine, there is no difference in the code.

BTW faggot, you're still confusing the abstract machine with the implementation itself. Now go scrub another toilet.

Name: Anonymous 2011-09-26 21:33

>>4
And your description really breaks down for Java. I'm suspecting this is because you don't know the difference between the Java language itself and the JVM.

Name: Anonymous 2011-09-26 21:34

>>15
You're not funny.

Name: Anonymous 2011-09-26 21:38

>>17
I'm not trying to be. Go read one the many fucking C standards you moron.

Name: Anonymous 2011-09-26 21:39

>>18
*one of the many*

Name: Anonymous 2011-09-26 21:45

>>15,18
kill yourself faggot

Name: Anonymous 2011-09-26 21:54

>>20
Listen little girl, there is a reason why those of us program who living preach the standards. This is because some of us have to compile the same fucking thing on 8 different platforms. If you have non standard/non conforming code, then the works becomes a lot more difficult.

But you wouldn't know anything about this. Now go scrub another toilet and keep studying SICP you fucking nowhere bitch.

Name: Anonymous 2011-09-26 22:00

it's nothing compared to memory allocation, deallocation, and cache coherency.

Name: Anonymous 2011-09-26 22:07

Are branch misses a problem in interpreted languages?

Name: Anonymous 2011-09-26 22:21

>>21
I only support GNU-C. Now kill yourself, faggot.

Name: Anonymous 2011-09-26 22:58

>>24
I only support GNU-C.
Then you're not an EXPERT PROGRAMMER

Name: sage 2011-09-26 23:03

>>15
You're visibly a complete illiterate, in the most obscene basic level. What the fuck are you talking about? Have you understood or even read anything that's been said?

Seriously, I fear you're retarded to a point way past of even minor recovery.

Name: Anonymous 2011-09-26 23:22

>>11
This is indeed an interesting source of information. I disagree on a couple of points described by the author, however; in some of them it seems to me that he's completely wrong.

For example, the author states that some common boolean arithmetic is typically implemented with branch trees. This seems rather absurd to me. Also, dynamic_cast is -extremely- costly if a type analysis is actually performed; in particular, much more costly than a virtual call -- maybe he should have stressed that. And, while pointer dereferencing is typically fast, sometimes it's slower than direct access by a considerable factor (pointer load, LEA and friends). The situation is much worse if pointer aliasing exists.

The material is nonetheless really valuable in the whole. Almost everything described is neutral knowledge to the assembly programmer, but he exposes it on a more tractable language. Despite that, some of his tips are really infeasible in my opinion (messing with code legibility or semantics to 'hint' an optimization to the compiler is particularly out of question to me).

Name: Anonymous 2011-09-27 0:31

SLACKWARESUPREMACY

Name: Anonymous 2011-09-27 0:58

>>15

this is just the "i wouldn't hire you", "go scrub a toilet", "go back to your job at arby's", etc etc guy.

Name: Anonymous 2011-09-27 1:32

SLACKWARESUPREMACY

Name: Grandma 2011-09-27 2:21

enum { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY };

if(day % 7 == TUESDAY)
bananas_chase_the_teddies();
else
normal_day();

Name: Anonymous 2011-09-27 7:51

>>24
I support your cause and will gladly fight alongside you.

Name: Anonymous 2011-09-27 7:57

>>32
Terrible!

Name: Anonymous 2011-09-27 9:07

>>33
Nice du[spoiler][spoiler]bz!

Name: Anonymous 2011-09-27 9:09

>>33
Nice dubz!

Name: Anonymous 2011-09-27 9:33

>>34-35
Fuck off, spammer.

Name: Anonymous 2011-09-27 11:24

__gnu_gcc_builtin_func_car_cdr_eval_apply(void *);

Name: Anonymous 2011-09-27 11:32

>>37
#include <lspintrin.h>

Name: Anonymous 2011-09-27 11:58

if (val) is much faster than if (val != 0) I benchmarked the old code with the faster if test and it resulted in a 230% speedup.

Name: FrozenVoid 2011-09-27 12:06

>>39
If your code is so inefficient that one 'if' results in 230% speedups post it here, i could save you at least 50% more speed.

Name: Anonymous 2011-09-27 12:46

>>40
The code is in >>1 all I did was to tightly loop it and then replace if (val != 0) with if (val).

Name: Anonymous 2011-09-27 13:31

>>41
Could you post the complete code, with the loop?

Name: Anonymous 2011-09-27 13:35

>>26
I was pointing out what you're talking about is non standard. You're more than welcome to try and cite any passage in one the the various ANSI/ISO C standards or JSP that supports anything that is being talked about in this thread.

So to put this in terms your jewish ass can understand, branch misses are platform specific, and hence, not covered by any of the standard. Get it hourly worker boy?

Name: Anonymous 2011-09-27 13:59

>>43
Kill yourself faggot.

Name: Anonymous 2011-09-27 14:03

>>43
Most code you write for actual devices that are not personal computers is written for a specific platform. Get back to your enterprise-grade cubicle. I'll be here with my robots.

Name: Anonymous 2011-09-27 15:01

>>43
Why do you keep trying to sell us this "C standards" nonsense?  We know it's snake oil, completely useless for real programming.  Nobody here is buying any, so you should go spam somewhere else.

Name: Anonymous 2011-09-27 15:03

>>46
Have you ever written a single like of production level code for any firm?

Name: Anonymous 2011-09-27 15:04

>>47
like

Name: Anonymous 2011-09-27 15:05

>>45
That is why you have a make file you illiterate jew.

Name: sage 2011-09-27 15:45

>>43
You don't need to point out the grotesquely obvious, you retarded midget. There's nothing in this thread that even marginally touches portability issues. There's nothing in this thread that could suggest, even in a fanciful gay dream your feeble brain could produce, that anything so far discussed could ever be portable, or standardized, or even preferred over portable code. It is horribly clear from the context that everything cited so far is non-standard, but you seem to lack very basic text comprehension skills.

Also, don't worry about citing standards. I know more, much more about standards than they actually deserve. In fact, I probably know more about every programming subject than you could ever hope to understand, and it's likely that I'm not alone. After all, you surely haven't correctly grasped a single bit of information from anything you've ever read in your life -- considering you have actually read anything --, since you just haven't been properly alphabetized.

Name: Anonymous 2011-09-27 19:47

>>50
You don't need to point out the grotesquely obvious, you retarded midget.

What do you do again for a living? What's your job title and company you work for? How many millions of people use the software that you write?

There's nothing in this thread that even marginally touches portability issues.

The context of the question revolved around C and Java. Ya know you fucking nigger, most people who ask questions not related to any standard would word the question differently.

I know more, much more about standards than they actually deserve. In fact, I probably know more about every programming subject than you could ever hope to understand

Oh really? So have you actually served on a committee? If so, can you please share the committee name and dates.

After all, you surely haven't correctly grasped a single bit of information from anything you've ever read in your life

You're projecting. Go scrub another toilet you fucking jew.

Name: Anonymous 2011-09-27 22:20

>>50
I remember one time he entered a discussion about assembly and argued that it was outside the scope of standard C and consequently threw an autistic fit when he was informed that the discussion was not about C at all.

He uses the standard like his bible and is completely unable to understand anything beyond its scope, like basic reading comprehension. I guess you could say that he's a, Creationist.

YEAHHHHHHHH

Name: Anonymous 2011-09-27 22:26

>>52
You also need to go scrub another toilet.

Name: Anonymous 2011-09-27 22:28

GNU-C and -fno-strict-aliasing. Everything else is for mental faggots.

Name: Anonymous 2011-09-27 22:30

>>53
My toilet is quite dirty indeed, I will do that tomorrow.

Name: Anonymous 2011-09-28 3:41

You are the slightly more intellectual equivalent of 'my dad works at Nintendo'. What is this wonderous software you write, and can you answer your own requirements of providing the name, product, and proof that you worked on it?

But I suspect you cannot, because none of your answers actually made sense at any point in the thread. Resorting to ad hominems and spouting inappropriate jargon that has nothing to do with the subject (USE MAKEFILES!) just marks you as either a delusional skiddie or a troll which I am currently feeding.

Please go back to reddit.

Name: Anonymous 2011-09-28 3:42

>>52
I LOVE YOU! I LOVE YOUR POST! I READ IT FIVE TIMES! KEEP POSTING!

Name: Anonymous 2011-09-28 4:09

C is my favorite language. I feel ashamed. I feel ashamed for Dennis Ritchie. Please don't think all C users are retarded like this guy.

Name: Anonymous 2011-09-28 6:29

>>58
Most of this thread is pretty bad. I feel dirty for posting in it.

Name: Anonymous 2011-09-28 6:32

>>59
I feel dirty for posting in it.
You should feel bad for not using the sage function when posting in it.

Name: Xarn 2011-09-28 6:57

SLACKWARESUPREMACYSLACKWARESUPREMACY

Name: Anonymous 2011-09-28 8:51

>>60
*bump*

Name: Anonymous 2011-09-28 10:50

>>62
*sage*

Name: Anonymous 2011-09-28 11:34

Standards considered harmful, enjoy your state of being worthless.

http://harmful.cat-v.org/standards/

Name: Anonymous 2011-09-28 11:44

If I had followed standards... no innovation... failure.  Cannot win without breaking standards.

I marvel at the stupidity of these people:
http://wiki.osdev.org/Main_Page

Have you ever met a musician in a band that is ripping-off the sound of some trend?  They are totally clueless that unoriginal is worthless and they are delsuionally proud because they think they're good.

Name: Anonymous 2011-09-28 11:56

http://forum.osdev.org/viewtopic.php?f=15&t=24177

The secret to my success is compatibility.  The fewer the possible sources of incompatibility, the better.  Interrupts are not as robust as polling.

I tried my OS on about 4 machines over the years and it didn't work on any one without modification!  Just like "it's the economy stupid", "it's compatibility stupid."

God says...
C:\TEXT\Brief\AUGUST.TXT

be hidden from it, it wills not.  But the contrary is requited
it, that itself should not be hidden from the Truth; but the Truth
is hid from it.  Yet even thus miserable, it had rather joy in truths
than in falsehoods.  Happy then will it be, when, no distraction
interposing, it shall joy in that only Truth, by Whom all things are
true.

See what a space I have gone over in my memory seeking Thee, O Lord;
and I have not found Thee, without it.  Nor have I found any thing
concerning Thee, but what

Name: Anonymous 2011-09-28 12:02

Not working on any one begs the question, "Does it work for anybody."  I get no emails but I'm #1 google rank.  That's a little odd, don't ya think?

God says...
C:\TEXT\BIBLE.TXT

 And when they had sung an hymn, they went out into the mount of
Olives.

26:31 Then saith Jesus unto them, All ye shall be offended because of
me this night: for it is written, I will smite the shepherd, and the
sheep of the flock shall be scattered abroad.

26:32 But after I am risen again, I will go before you into Galilee.

26:33 Peter answered and said unto him, Though all men shall be
offended because of thee, yet will I never be offended.

26:34 Jesus said unto him, Verily I say unto the

Name: Anonymous 2011-09-28 12:08

>>65
You forgot the bible quote, faggot.

Name: Anonymous 2011-09-28 12:20

>>52
Yes, the guy's so inept he failed to see that there are about three or four different people arguing with him (or, more precisely, being heavily trolled by him). Yet he took all of them for a single one. I guess this is indeed a sign of autism.

>>56
Fuck off, misfit. You trolled us hard already.

>>64
>>65
There's a very important point on creating and conforming to standards. However, as far as compliance goes, there are very few important implementations that fully comply to a given document. This makes people inevitably depend on extensions (since they won't and shouldn't bother, for example, sprinkling #ifdefs to detect particular differences between C compilers), specially because most people don't even know about standards, or don't bother reading long, prolix documents that, in practice, only diminishes their productivity.

Also, as per definition a standard encompasses the minimum common set of features for a given set of architectures, they always tend to deny support for newer technology (and by newer I actually mean "concurrent execution" and "networking" in pure C, as incredible as it seems), sticking only with long-dated primitivisms.

All of this means that one can expect much less than he wished for when dealing with standards, since they fail grossly on solving the single problem they were supposed to solve: portability.

For example, there is a ridiculous number of compilers that -fully- comply to C99: GCC and MSVC ain't two of them. (C99 is a ten-year-old document already, and C1X is already being baked.) The situation is much worse for C++98.

Name: Anonymous 2011-09-28 12:48

>>69


Holy Shit!  Somebody intelligent and honest from outside the wall!  I've had nothing but indirect talk and "Piccard, how many lights do you see?"

Hold-on. 

This little fucker...
http://forum.osdev.org/viewtopic.php?f=1&t=12087&start=1080

I was using the CPUID to check for 64-bit capable and print a message if not.  I was reading abn OSDev story and they had code that checkded first if the bit to check for 64-bit was present.  I was like, "Oh, I guess I could add that."  NExt thing I know, they're wanting credit--like my operating system is written by me and John Smith.  I said "fuck that".  I removed the extra test for ancient processors.

http://www.losethos.com/code/BootCD.html

To this day, it doesn't have it.  Fortunately OSDev has been pretty useless.  I joke -- "Whatever you do, don't ever read GPL code or you cannot ever work for a real company cause you will have seen things first, there, and cannot use them!"

The bigger question is, "How the fuck have people been watching me and what an annoyance that it's not the same people who would know that I wrote everything and they're pestering me!"

I guess it's Heaven--Monty Python argument clinic.

http://www.youtube.com/watch?v=kQFKtI6gn9Y

Name: Anonymous 2011-09-28 13:12

>>69
56 was actually a response to the troll..

Name: Anonymous 2011-09-28 13:14

>>69
56 was actually a response to the troll..

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-09-28 19:55

>>69
Also, as per definition a standard encompasses the minimum common set of features for a given set of architectures, they always tend to deny support for newer technology (and by newer I actually mean "concurrent execution" and "networking" in pure C, as incredible as it seems),

Do you realize how much legacy code would break if you would attempt to incorporate "concurrent execution" and "networking" into the standard? I bet you don't.

Name: sage 2011-09-28 20:48

>>73
None, since these are additions, not semantic changes.

You? Oh, you're just another teenager with social disabilities that doesn't even know what "legacy code" really is.

Name: Anonymous 2011-09-28 23:41

>>74
I'm with >>73. In a concurrent environment some semantics will change underneath you. Non-reentrant code becomes unsafe.

But I'm with you too. C is old.

Name: sage 2011-09-28 23:55

>>75
Legacy code would still be single-threaded, suffering no harm from such situations. (I'm not talking about automatic parallelism.) For new code, reentrant versions of classic routines would exist (as in POSIX).

There would be new semantic requirements for memory fencing, atomic operations and guarantee of execution progress, similar to those documented by POSIX and C++11, but still legacy code wouldn't be affected, except by potential symbol name collision.

Name: Anonymous 2012-01-26 0:34

>>31

Lame-da Calcyaless.

SQWARK SQWARK!

Name: Anonymous 2012-01-26 0:35

>>77
Typical Jew.

Name: Anonymous 2012-01-26 0:38

>>78

#include <conio.h>

Name: Anonymous 2012-01-26 1:15

>>78
Tropical Chew

Name: Bishnu 2012-01-28 3:58

I am Bishnu, Hindian spawn of Yashavant Kanetkar. I tell you, all to use Turbo C and Let Us C!

Name: Anonymous 2012-01-28 6:09

>41
Could anyone answer this question for me?

Name: Anonymous 2012-01-30 0:03

Wormies in the brain!

Name: Anonymous 2012-01-30 0:03

░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▄░█░█░▄▀▀▄░░█░░█░█▀▀░▀█▀░█░░░
░█░█▄░█░█░▄▄░░█▄▄█░█▄▄░░█░░█░░░
░█░░█░█░▀▄▄▀░░█░░█░█▄▄░▄█▄░█▄▄░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Name: Anonymous 2012-01-30 0:09

Wormies in the bum!

Name: Anonymous 2012-01-30 0:19

Boreland vs. ANSI
India vs. America
Yashavant Kanetkar vs. Grandma
16 bit vs. 32/64 bit

Conio Gains Turbo Trainers!

Name: Bonky The Koala 2012-01-30 0:30

Tehoo

Name: Anonymous 2012-01-30 1:10

>>6
Cortex-A9
toy CPUs
Go back to Yishrael, kike.

Name: Anonymous 2012-01-30 3:52

>>88
What's the matter? Your toy CPUs cannot carry out the same processing capability per clock. Only real chips have the balls to do the work.

Name: Anonymous 2012-01-30 6:16

Want to learn Punjabi? Simple! Sit on the floor poking at your poop all day and you'll learn.

Name: Anonymous 2012-01-30 8:09

>>89
>2012
>CISC

Name: Anonymous 2012-01-30 10:50

>>89
x86 was and still is a toy CPU

Name: Anonymous 2012-01-30 11:42

>>91,92
In the eyes of the Juden, insulting Intel's shit Jew chips makes you a naziwhowantstokillsixmillionjews.

Name: Anonymous 2012-01-30 11:47

>>92
lol it's the fastest today, eat dicks, faggot

Name: Anonymous 2012-01-30 11:49

>>94
Eat a Jew's circumcised cock, shabbos goy.

Name: Anonymous 2012-01-30 12:54

This thread is very good. I'm taking notes. Everybody read it!

Name: Anonymous 2012-01-30 22:51

>>1

probably only need to do this once you've -near- finished optimizing a performance-critical code =) and your ifis sitting in a big loop (/gets used a lot)

but yeah, it is faster to skip a branch rather than take it i think...

Name: Anonymous 2012-01-30 23:44

>>97
and your ifis sitting in a big loop
You mean a small loop - if it's a big loop, a smaller percentage of the time inside the loop is spent on the conditional.

=) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =) =)

Name: Anonymous 2012-01-31 1:50

>>98

small loop with lots of iter, yeh, u know what i ment anyway =D

Name: Anonymous 2012-01-31 1:56

I want to put my branch into a missus. One with a nice pair of double d dubs!

Name: Anonymous 2012-01-31 7:16

>>31

This is especially true to day, senior citizen. donkey.com.

Name: Anonymous 2012-01-31 10:22

Nutbags beware, you're in for a scare.

Name: Anonymous 2012-02-01 6:53

>>102

That includes the average 4chan wacko.

Name: Anonymous 2012-02-01 12:49

So, what do you all think of donkey.com?

Name: Anonymous 2012-02-02 5:04

4chan has wackos, the other "chan"s have crippled asian kids. donkey.com has donkeys.

Name: Anonymous 2012-02-02 6:32

Branch misses? More like toilet bowl misses.

Name: Anonymous 2012-02-03 6:59

Oops! I made weewee on the floor!

Name: Anonymous 2012-02-04 12:30

Wankee doodle went to town riding on a pony.

Name: Anonymous 2012-02-04 13:03

>>105
I've seen more creative coding done by the teenie weenies on Yahoo Checkers than I have seen done by the adult toilet scrubers here on /prog.

Name: Anonymous 2012-02-05 3:25

Put his willy in his hat and called it a macaroni.

Name: Anonymous 2012-02-05 3:49

Trips, Czech'em

Name: Anonymous 2012-02-07 4:15

Who is making fluffies?

Name: Anonymous 2012-02-07 4:24

>>1
That code is inappropriate. There are children that post on /prog/.

Name: Anonymous 2012-02-07 4:35

Name: Anonymous 2012-02-10 5:09

DURRRR I MISSED THE TOILET BOWL AGAIN!

The Land of Lisp!

Name: Anonymous 2012-02-10 13:45

All over the floor too.

Name: Anonymous 2012-02-10 14:01

>>39
This is not related to branch misses at all. And seriously, which compiler are you using? Not optimizing such a trivial case?
>>4
loop stream detector
sounds interesting. but 16 bytes? how many instructions is that?

Name: Anonymous 2012-02-10 15:22

<--- check 'em

Name: Anonymous 2012-02-10 15:33

>>117
Probably the TrollSoft C/C++ de-optimizing compiler.

Name: Anonymous 2012-02-15 23:15

More like the Donkey.com wagon.

Name: Anonymous 2012-02-15 23:16

Look at me, I eat donkeys for breakfast. I sure am taking notes about toilet bowl misses, grandpa!

Name: Anonymous 2012-02-21 22:26

BANANAS IN PYJAMAS

Name: Anonymous 2012-03-29 13:26

*pees all over the floor*

TOILET BOWL MISSES.

Name: Anonymous 2012-03-29 14:21

>>120-123
Same meme forcer.

Name: Anonymous 2012-03-29 14:34

         _,. .--::::::::::::- .、
      .,.':::::::::::::::::::::::::::::::::::\
     .,':::::::::::,:::::::::::::::::::::::::::::::::::'.,
     /::::::::/:::::::::::::::::::::::::::::::::::::::',
    ,':::::::/::、__/............λ 、::::ヽ:::i
     i::::::,'::::::::::/-─-/ i:::/i_;::::::::i::::i   
    .i::::::::`iヽi.,.--- '、 レ' i::`イ/:::::|
   .|:::::::::/|::::i ""     '"ヽ/ヘ/::/    > tfw i was the original creator of this thread
   |:::::::,'::::i....i '.,   、_  ",'i:::|:;/
    |::::::::::::::',::',/へ、  __,,.イ::|:::|
   ,':::::::,- '´ヽiヽ、 ~〈ヽ;;;;::|::,'::::|  ( ::)
  ノ:::::/   ヽ、`ヽy / ヽレ'|:::::| ( ::)
  ,':::::/、.    ',/^ー:r ̄ ̄ ̄i:|
 /::::',     /    ノ、___ノ 〉
.,'::::::::i,へ/ 「 ̄ヽrー´i l   ̄iイ::|

Name: Anonymous 2012-03-29 20:27

>>6

ARM   Cortex-A9:         0.2875 MIPS/MHz/thread
SPARC Sun UltraSPARC II: 0.7 MIPS/MHz/thread
MIPS  ICT Loongson 3A:   0.72 MIPS/MHz/thread
POWER IBM POWER7:        0.76 MIPS/MHz/thread
IA64  Itanium 2:         0.93 MIPS/MHz/thread
x86   AMD K5:            0.92 MIPS/MHz/thread
x86   Intel i5-2400:     1.24 MIPS/MHz/thread

WHERE IS YOUR RISC GOD NOW?

Name: Anonymous 2012-03-29 21:05

>>126
x86   Intel Pentium 4  0.447 MIPS/MHz/thread
When a company has as many orders of magnitude of dollars more than their competitors as Intel does, they could make any CPU architecture run fast. If /prog/ had 100 times more money than Intel, /prog/ could make a 10 THz Brainfuck CPU and then buy out all of the Intel fabs (like Intel did to DEC/COMPAQ and HP). Who needs multiplication instructions when you have 300 million transistors for ``BrainFuckFusion'' to analyze Brainfuck loops?

Name: Anonymous 2012-03-29 22:07

>brainfuck chip
>WANT

Name: Anonymous 2012-03-29 22:37

>>127
Did you notice the AMD chip there? AMD has nowhere near the amount of money Intel does. And yet...
AMD Athlon 64 X2 (K8): 0.90 MIPS/MHz/thread

There's also this dark horse:
MCST Elbrus-3S: 1.25 MIPS/MHz/thread

which is apparently "VLIW" but also "x86 compatible".

Name: Anonymous 2012-03-29 22:55

>>129
``MIPS/MHz'' is an absolutely meaningless statement. What processor are these ``MIPS'' measured for? What is considered an ``instruction''? Are all ``instructions'' weighted equally? Are page faults and cache misses taken into account? Is the CPU run in 32-bit or 64-bit mode (if applicable)?
MCST Elbrus-3S (1891WM5AyA) CPU, 500 MHz, 218M transistors, 90 nm, 9-metal layer, 142 mm2. Power: 13-20W.
Power usage is also important. This CPU is much slower than a 1.6 GHz ARM Cortex which uses less than two watts.

Name: >>130 2012-03-29 22:59

>>129
This measurement would make sense only if the object code was identical on all processors. Otherwise your ``MIPS/MHz'' is saying more about the compiler's optimizations than it is about the CPUs it runs on.

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2012-03-30 6:40

>>130,131
It's a benchmark of total throughput per clock. "MIPS" is not a good term for this, they should call it 7marks or something like that. If you read the fine print at the bottom you'll see that the Intel Core 2 is taken as a reference at 1MIPS/MHz/thread. Then more efficient than it would be >1, less would be <1.

The best RISC one there is the POWER7 at 0.76 MIPS/MHz/thread, and it's not exactly power (lol) efficient either -- 200W TDP!

I've been saying this for years: CISC is going to have IPC and total throughput advantage. You can pump the RISCs to go really fast but then you're limited by the less dense code (more cache misses) and physical limits like power dissipation. In comparison a CISC won't have as many instructions and this makes for less cache misses and lower memory bandwidth, sort of like having compressed instructions in memory and decompressing them in the on-die decoder. Intel still has a lot of improvement they can do with x86 microarchitecture optimization like moving more instructions out of microcode, they just haven't seen the need to do it yet. But as memory bandwidth becomes the limiting factor for throughput it is clear that CISC-like designs are coming back and going to be the future.

Name: Anonymous 2012-03-30 6:59

check 'em

Name: Anonymous 2012-03-30 21:47

I've been giving some branch to your missuz.

Name: Anonymous 2012-08-11 12:14

What about MIPS/watt?

Name: Anonymous 2012-09-25 8:44

>>1
>2012
>Shit in Anus

Name: Anonymous 2012-09-25 10:07

>>132
thumb instruction set
checkmate, faggot

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-09-26 3:25

>>137
http://www.csl.cornell.edu/~vince/papers/iccd09/iccd09_density.pdf

Thumb is a step in the right direction, but it's still more limited than x86. It's missing things like divide/multiply and generalised addressing modes.

Name: Anonymous 2012-09-26 5:59

This is why JIT/self-modifying code is the future.

Name: Anonymous 2012-09-26 20:37

>>139
only if it's javascript v8

anything else is just a dead end, not to mention completely incompetent

Don't change these.
Name: Email:
Entire Thread Thread List