﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25805	Django 1.8 startup takes longer than Django 1.7	Filipe Pina	nobody	"Hi, this is less of a bug and more of a RFI..

I've recently noticed on a django (1.8.6) project I run in a Raspberry Pi (model B+) that manage.py always takes more than 20secs to import all modules. I assumed it was due to RPi poor performance but then I noticed on a different project (that uses django 1.7.x) that it took less than 7 secs to do the same.

Steps to reproduce (and compare):


{{{
[fopina@izdoors test2]$ virtualenv2 env
New python executable in env/bin/python2
Also creating executable in env/bin/python
Installing setuptools, pip, wheel...done.
[fopina@izdoors test2]$ . env/bin/activate
(env)[fopina@izdoors test2]$ pip install Django
Collecting Django
  Using cached Django-1.8.6-py2.py3-none-any.whl
Installing collected packages: Django
Successfully installed Django-1.8.6
(env)[fopina@izdoors test2]$ django-admin startproject t18
(env)[fopina@izdoors test2]$ cd t18/
(env)[fopina@izdoors t18]$ time (echo 1 | python manage.py shell)
Python 2.7.10 (default, Sep 17 2015, 19:25:26) 
[GCC 5.2.0] on linux2
Type ""help"", ""copyright"", ""credits"" or ""license"" for more information.
(InteractiveConsole)
>>> 1

>>> 
real	0m23.555s
user	0m22.810s
sys	0m0.480s
}}}

And with 1.7.10, on the same Pi:

{{{
[fopina@izdoors test]$ virtualenv2 env
New python executable in env/bin/python2
Also creating executable in env/bin/python
Installing setuptools, pip, wheel...done.
[fopina@izdoors test]$ . env/bin/activate
(env)[fopina@izdoors test]$ pip install Django==1.7.10
Collecting Django==1.7.10
  Downloading Django-1.7.10-py2.py3-none-any.whl (7.4MB)
    100% |################################| 7.4MB 3.2kB/s 
Installing collected packages: Django
Successfully installed Django-1.7.10
(env)[fopina@izdoors test]$ django-admin startproject t17
(env)[fopina@izdoors test]$ cd t17/
(env)[fopina@izdoors t17]$ time (echo 1 | python manage.py shell)
Python 2.7.10 (default, Sep 17 2015, 19:25:26) 
[GCC 5.2.0] on linux2
Type ""help"", ""copyright"", ""credits"" or ""license"" for more information.
(InteractiveConsole)
>>> 1

>>> 
real	0m7.689s
user	0m6.340s
sys	0m0.400s
}}}

I've tried going through the imports done in 1.8 to see if there was anything I could do to improve its time but I failed to identify the guilty ones...
I've downgraded my application to django 1.7 because it has a lot of management commands and I had no impact, but I was wondering if it's a known fact that 1.8 has a lot more (or heavier) imports than 1.7..

Thanks"	Cleanup/optimization	closed	Uncategorized	1.8	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
