Live data from Hacker News

Python Entry Points Explained

amir.rachum.com

11–14 of 14 posts

Re: Python Entry Points Explained

#11
post #8

Entry points are excellent at making your scripts start slooooooooow. Compare $ time python -m pyflakes /dev/null real 0m0.225s user 0m0.103s sys 0m0.008s with $ time pyflakes /dev/null real 0m2.468s user 0m1.738s sys 0m0.055s

I did not get as dramatic of results as you.

  # python3 -m venv example
  # source example/bin/activate
  (example) # pip install pyflakes
  Collecting pyflakes
    Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB)
      100% || 225kB 892kB/s 
  Installing collected packages: pyflakes
  Successfully installed pyflakes-1.5.0
  (example) # time for i in {00..99}; do python -m pyflakes /dev/null; done
  real    0m7.167s
  user    0m6.407s
  sys 0m0.750s
  (example) # time for i in {00..99}; do pyflakes /dev/null; done
  
  real    0m7.661s
  user    0m6.894s
  sys 0m0.753s

Re: Python Entry Points Explained

#12
post #8

Entry points are excellent at making your scripts start slooooooooow. Compare $ time python -m pyflakes /dev/null real 0m0.225s user 0m0.103s sys 0m0.008s with $ time pyflakes /dev/null real 0m2.468s user 0m1.738s sys 0m0.055s

I did not get as dramatic of results as you. # python3 -m venv example # source example/bin/activate (example) # pip install pyflakes Collecting pyflakes Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB) 100% || 225kB 892kB/s Installing collected packages: pyflakes Successfully installed pyflakes-1.5.0 (example) # time for i in {00..99}; do python -m pyflakes /dev/null; done real 0m7.167s user 0m6.407s sys 0m0.…

I guess it gets worse when you have more stuff installed in the environment.

Re: Python Entry Points Explained

#14
post #13

What is the actual value of entry points over just marking a script +x and putting somewhere on the path? All I see is a bunch of added complexity.

Answering this question was pretty much the entire point of the article. I felt that each section gave a concrete example of a situation where the solution in the previous section fell short and then introducing some new complexity to handle it.
Post reply on HN