r/Python • • Jun 27 '18

Python 3.7.0 released

https://www.python.org/downloads/release/python-370/
1.3k Upvotes

293 comments sorted by

View all comments

Show parent comments

2

u/billsil Jun 28 '18

The startup problem has more to do with standard module design. Everyone imports everything at the beginning that they may use so they don't have to do it in a small loop (that turns out doesn't matter), or IMO the worse issue of crashing on some import that you forgot to update because it's in a function. The "flat is better than nested" idea is great for an API, but terrible for speed.

My 120k lined 3d gui has a command line option. You'd better believe I do argument validation before importing everything. I also try to minimize interconnectedness. However, do I really need all of BLAS from scipy to do linear interpolation?

Don't blame python for murcurial's poor design choice.

1

u/13steinj Jun 28 '18

Did you even read the mailing list?

Py2 doesn't have the issue! It's Py3 problem.

One of the major reasons this occurs is because the import machienry changed to allow extreme amounts of extensibility. But this also slowed things down.

The fact that Py3 attempts to import from dozens of paths while Py2 does significantly less is also an issue, as well as the unoptimized code that was written. Among god knows what else-- when I asked for specifics as to why Py3 imports that much slower no one knew beyond these attributes I'm listing.

I'm not arguing against Py3 being good. I am simply stating the objective fact that for various reasons the startup time for Py3 is unimaginably slower, and for validation / verification scripts and CLI tools, that is an enormous problem!

0

u/billsil Jun 28 '18

Did you even read the mailing list?

Put a break point and watch your code execute...

1

u/13steinj Jun 28 '18

....what?

1

u/billsil Jun 28 '18

What is confusing and why?

→ More replies (0)