So this is the power of python 2.7

The best part about this image is the ass blasted comments from game stop employees who took Intro to Java and larp they are programmers online.

Btw do you guys have battle toads?

Other urls found in this thread:

youtube.com/watch?v=ALZHF5UqnU4&list=RDQMOv95jIhGdkg
twitter.com/AnonBabble

i dont get it.

you traded the memory complexity for time complexity?

This is Sup Forums. Stop expecting these "programmers" to know what memory complexity is. In fact I wouldn't be surprised if he didn't even know what time complexity was :^).

>using the smiley with a carat nose

>he doesn't know about the time command in *nix

>knows what big O is
>thinks he's special

Nice crypto desktop thread

i do but time added ~0.05 seconds

Thanks for taking the bait gentlemen :^)

Nobody cares about memory complexity anymore

>takes a discrete math class at community college
>now self declared king of Sup Forums

>retard spotted
People don't care about constant factors on memory usage anymore, but they damn sure care about memory complexity.

People like you are cancer

please rewrite it in C and glue it with Python

The Sieve of Eratosthenes is pop-maths you should know from high-school, so don't think you can lord over those gamestop employees just yet.

If you're a beginner, then well done. Now learn Lisp.

And honestly, even that's not true. Constant factors are still important, just not fixed costs.

>using the smiley with a carat nose

Theme music for this thread. Thanks OP you are the hero python 2.7 deserves!

youtube.com/watch?v=ALZHF5UqnU4&list=RDQMOv95jIhGdkg

I don't get what this thread is about. But my sieve is faster, and uses less memory.
$ time python3 sieve_of_Eratosthenes2.py
1075207199997334

real 0m33.612s
user 0m33.572s
sys 0m0.040s

>python stronk!
Get in the slow lane. A real programming language is driving in the fast lane.

0.842868
1075207199997334
Program ended with exit code: 0

#include
void main() {
printf("1075207199997334\n");
}

>implying
Test the code yourself faggot. Here it is in text form so you can copy/paste. If you even have or know how to operate a C compiler that is.

My time is from a Core i7 MBP using Xcode with optimizations on.

>33s vs. 0.8s
Yeah. Python is that fucking slow.

#include
#include
#include
#include
#include
#define ISBITSET(x, i) (( x[i] & (1

>My time is from a Core i7 MBP using Xcode with optimizations on.
what optimizations?
O1 :
0.675089
O2 :
0.6183089
O3 :
0.647160

use register keyword with loop variables
Don't use O3 as you code can't be vectorized in any way and contain no recursive call

>#include
useless

>char* b = (char*)malloc(bsize * sizeof(char));
>memset(b, 255, bsize);
Timesink, you should put it outside sumprime if you want an accurate time.
also
>what is calloc

>no free
why? You used memset but not free.

You shouldn't use bit-manipulation macros with int if you want to manipulate long long int. It works here but not every times.

>>My time is from a Core i7 MBP using Xcode with optimizations on.
>what optimizations?
Ofast.

>Don't use O3 as you code can't be vectorized in any way and contain no recursive call
Doesn't actually make a difference. Run multiple times at each setting, the variance from run-to-run for a setting is larger than the difference you pasted, and O3 or Ofast is just as likely to be faster on any given run as not.

>>char* b = (char*)malloc(bsize * sizeof(char));
>>memset(b, 255, bsize);
>Timesink, you should put it outside sumprime if you want an accurate time.
It's required to solve the problem so it's part of the time.

>also
>>what is calloc
malloc+memset forces the kernel to allocate the memory. calloc (depending on OS) might only allocate the address space. Page faults during processing would hammer processing time.

>>no free
>why? You used memset but not free.
You are right!

>You shouldn't use bit-manipulation macros with int if you want to manipulate long long int. It works here but not every times.
Another good point.

I must really suck at c
> time ./a.out
Result: 1075207199997334
7.40user 0.08system 0:07.49elapsed 99%CPU


Actually just started reading K&R yesterday

No, we don't have it in store but I can order it for you.

Console font?

Not bad, but just use the builtin sum at the end there.

print(sum(sieve(2e8)))

Congrats if you posted in this thread ABOVE this image you are one of the dozens of actual programmers on Sup Forums. If you didn't and you are, better luck next time!

>pretending
Sure thing

op here, i'm not even mad

OP here, all real programmers respect that C++ is faster than Python

OP here, fuck you i'm learning C++