Python 2.7

python 2.7
import time

def start():
first = time.time()
for n in range(1000000):
print n
last = time.time()
print "time: " + str(last - first)

>4.5


python 3.x
import time

def start():
first = time.time()
for n in range(1000000):
print(n)
last = time.time()
print("time: " + str(last - first))

>5.8

>Abandon Python 2 they said
>Advance with the technology they said

Attached: 45g7h98435v042jf02j380f.jpg (1600x858, 87K)

Other urls found in this thread:

pythonclock.org
twitter.com/SFWRedditGifs

Cool I lost about 0.9 seconds

well just keep use py2 then, theres literally nothing stopping you

>theres literally nothing stopping you
i hope so..
python2 will ultimately lost support in the future
And you can imagine how bloated Python4 will be

pythonclock.org

>Python4
are they gonna break the compatibility again?

Python isn't used for performance. If you want to actually do anything, use C++ or something.

>pythonclock.org
lel fuck me

right.. but its getting slower and it should be improved/better/faster

Python3 is a complete disaster.
Even the print function got worse
Back in the day:
print "some shit without newline",
Now:
print("some shit without newline", end="")

install lua

>stop using y install x
thank you
This is not the only thing unfortunately too many libraries are updated in favor of new versions
I think I'll start studying C and stay in this area
Bummer

You insulted me for shilling Perl but this is literally the next best alternative.

While Python 3 is slower than Python 2, the latter is still slow as shit. Use another language if you need something fast (which you probably don't).

>4.5 seconds is anywhere near a sane amount of time for one million integer prints

Attached: le smirking rubbish man.jpg (300x400, 31K)

> cares about performance
> uses python

Attached: 1561868759944.jpg (640x480, 37K)

>literally the next best alternative
why do you think so JAVA and PHP are still exist
>(which you probably don't)
Why do you suppose that?
The most important thing in the software is ultimately speed
Anyone who thinks differently is mentally handicapped

both are slow as fuck
even JavaScript is faster

In urban form it is true to laugh about it
But do not forget that if I need to write software
What will take you to write in Python 10 minutes will take you considerably more time in any other language

python 2.7.16
>time: 5.47631287575
python 3.6.8
>time: 3.8782217502593994

OP is always a lying faggot

The new version is good for consistency but they really should have left the old version in there as well.

talk is cheap
show me the code

You are not supposed to to use this language anyways.

Attached: Screenshot_2019-07-06 The programmer who created Python isn't interested in mentoring white guy (1197x1045, 773K)

are you using windows 10 you fucking pajeet?

what's your pc/laptop spec?

nope

If you care about speed and are using python then you don't care about speed, otherwise you would be using something else from the start.

I want the blue python to fuck me in the ass while I fuck the yellow one in the cloaca.

printing to the console has a huge overhead you absolute fucking faggot. take it out and the speed will prob 10x

If you care about performance you will choose the other language even if it takes you literally 12 minutes instead of 10, of which 1 minute is spent in the optimized production compilation.

Be real, 7 of those 10 minutes are for thinking how to solve the problem, 3 for typing it. Python is not that much easier to type than other stuff. Specially when other languages have IDEs that can do half the typing for you because they can infer types (heh) to offer better autocompletion.

it's like python2 isn't handling unicode properly and writing to a terminal is slow and doesn't matter

What do you want to get out of there exactly?
It has a total of 2 print commands
It's the same code for short

I do not know what you did. It works fine on my machine
also this fagot confirm

This. Even fucking shell scripts can be faster

>using print() as benchmark
retarded.

Yeah, but look at the memory footprint.

>The most important thing in the software is ultimately speed
Don't tell me you actually believe that. Speed is second in importance to correctness. And in most cases, the important time to measure is from when you start coding to when you're done and not run time of the software itself.

Also, note how I said 'probably'. You might have a use case where runtime performance is important. But that's not most software. And again, if you have such a use case, Python might not be the best language for that.

Imagine being this pants-on-head backwards retarded.
>It only took me 5 minutes to write! It doesn't matter that it take 500x longer to run than yours!
I replaced a python script for equirectangular conversions that took 3-4 hours per image with a C++ implementation that took 2 minutes, and then I further moved it onto CUDA which took less than a second.
What used to take us entire fucking weekends to process, check, then have to reprocess with tweaked settings now takes us less than the time it takes the type in the command line arguments.

Don't be a moron.

2020 we pull the plug on py2 life support. Finally the headache dealing with 2 versions will be gone.

> performance doesn't matter

Imagine being this illiterate. See
>You might have a use case where runtime performance is important

me either m8 i've only helped yellow girls with their course work. hasn't really panned out for me yet but they smell nice so it's ok

>Finally the headache dealing with 2 versions will >be gone.
fuck off python3 amateur

Enjoy your tauthon or some other "maintained" fork youre going to use, faggot. Want to see your face when all the newer packages drop py2 support.

If there is any performance issue in this very primitive example, it's likely due to how python3 strings actually dont suck and how range use a generator that may induce more compute overhead for such a trivial example.

This

This works on Python 2.7, but not 3
def f(x):
exec("y = 0")
print y


The fact that Python 3 takes away some of these awesome dynamic programming power is absolutely niggerlicious.

Attached: 1558897700843.jpg (1116x932, 473K)

>print function
Print in python 2 was a statement not a function, which was why it changed in 3.

Works until 2020

def f(x):
exec("y = 0")
print(y)

This works in python 2 and 3

Beautiful support from you in 1000 projects made and going to be destroyed
Because of pointless nonsense

it meant for that faggot

The only pointless thing is supporting two very similar languages. Py2 was chosen to be destroyed and that is what is going to happen. Tbh should never have extended eol from 15 to 20.