3 ms·
Here's the full benchmark suite from speed.python.org showing what is faster and what is slower in 3.6 as compared to 2.7: https://speed.python.org/comparison/
by rplnt 9y ago
Here's the full benchmark suite from speed.python.org showing what is faster and what is slower in 3.6 as compared to 2.7:
https://speed.python.org/comparison/?exe=12%2BL%2B3.6%2C12%2BL%2B2.7&ben=616%2C617%2C618%2C619%2C620%2C621%2C622%2C623%2C624%2C625%2C626%2C627%2C628%2C629%2C630%2C631%2C632%2C680%2C633%2C634%2C635%2C636%2C637%2C638%2C639%2C640%2C641%2C642%2C643%2C644%2C645%2C646%2C647%2C648%2C681%2C649%2C650%2C651%2C652%2C653%2C654%2C655%2C656%2C657%2C658%2C659%2C660%2C661%2C682%2C662%2C663%2C664%2C665%2C666%2C667%2C669%2C668%2C670%2C671%2C672%2C673%2C674%2C675%2C678%2C677%2C676%2C679&env=1&hor=true&bas=12%2BL%2B2.7&chart=normal+bars https://speed.python.org/comparison/?exe=12%2BL%2B3.6%2C12%2...
It would be very hard for someone to say "python 3 is considerably slower". Startup is significantly slower, yes, but that's about it.
- dom0 9y agoIt's not like it should surprise anyone. The import machinery in Python 2 was mostly written in C, while it's pure Python in Python 3. And if you've seen what that stuff does it's no surprise that even fairly small applications can take .1-.2 s to reach main. A tool gathering imports in one file if it is safe to do so would be really quite neat for deploying interactive Python applications (command line / GUIs). On the more extreme end you'd have a C application linking not too many libraries (symbols are lazily loaded, libraries are not) that reaches main after 0.0001-0.0002 s (i.e. one to two hundred µs). On the other extreme would be Java apps using heavy runtime-code-generating frameworks like Spring, where even a trivial app can take up to ten seconds to spring to life.