Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python takes a lot of time to compile, ~ 25m #1

Open
jriguera opened this issue Jul 5, 2017 · 1 comment
Open

Python takes a lot of time to compile, ~ 25m #1

jriguera opened this issue Jul 5, 2017 · 1 comment
Labels

Comments

@jriguera
Copy link
Member

jriguera commented Jul 5, 2017

This is because is compiled with all available optimizations.

If you do not mind compiler optimizations, just remove the flag --enable-optimizations in this section:

echo "Building and installing Python ... "
pushd Python-${PYTHON_VERSION}
  ./configure --enable-optimizations --prefix=${BOSH_INSTALL_TARGET}
  make -j 4
  make install
popd

And Python will compile in less than 5 minutes.

You can also play with the number of compilation jobs that make will spawn, usually should be based on the number of cores of a vm, normally 4 jobs is quite ok for a 2 cpus vm ...

@Rylon
Copy link

Rylon commented Jul 10, 2017

It's worth noting that without the --enable-optimizations flag, you can see a reduction in Python performance by anywhere from 10 to 20%.

For example one of the optimisations included with that flag is Profile Guided Optimisation, there are some benchmarks showing the difference here:
https://www.activestate.com/blog/2014/06/python-performance-boost-using-profile-guided-optimization

So essentially this is a trade off between optimising for build performance or optimising for execution performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants