[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

#include <iostream> using namespace std; int main() {

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 1

File: 1346707187039.jpg (242KB, 470x425px) Image search: [Google]
1346707187039.jpg
242KB, 470x425px
#include <iostream>

using namespace std;

int main()
{
int a=0;

for(a; a < 10000000000; a = a + 1 )
{
}

cout << "value of a: " << a << endl;
return 0;
}


Basic performance program.

If it takes longer than 5 seconds to complete, your machine is under-performing by today standards.
>>
I'm not running that shit
>>
>using namespace std;

L O L
O
L
>>
>>58654986
Bet the loop will be optimized away anyway.
>>
>>58655984
this

shit program, OP
>>
>>58655984
not if you disable optimalizations
>>
>>58654986
Shit that fits entirely in the L0 cache is not a good benchmark by any means. It's a nice wake-up call for programmers though, as even such trivial shit can take so much time.
>>
>>58654986
>int
>10000000000
OK
>>
>>58654986
it's been a few minutes and it has not completed
>>
Is this what computer code looks like? I thought it was 0s and 1s?
>>
>>58656073
explain?
>>
>>58656147

that's at the very bottom of the totem pole. programming today uses layers of interpreters, so it has ideally a degree of readability.
>>
>>58656215
This program is too small - it will never invoke reads from RAM. When program becomes too big to fit entirely in the CPU cache(99% of your software) it can become magnitudes slower.
>>
>>58655984

maybe if the variable was declared within the for loop, but since its external, I doubt it would.
>>
>>58656413
thanks
Thread posts: 15
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.