[Bf-committers] cache python scripts for re-distribution.

Campbell Barton ideasman42 at gmail.com
Wed Oct 5 02:10:47 CEST 2011


At the moment we're not caching scripts for packages we re-distribute
on blender.org.

For most cases its not all that bad, blender just takes a little
longer to startup for the first time + a few ms longer to access lazy
loading modules for the first time.

Worst case is the user who runs blender hasn't got write permissions
to the directories blender is installed in so blender will always have
to parse the scripts rather then accessing __pycache__ dirs.

Overall I realize this isn't a big deal but its pretty easy to do this
so we might as well IMHO.


Some quick time checks.

Warm Start:
* with cache: 0.471s
* without cache: 0.945s

Cold start:
* with cache: 6.372s
* without cache: 7.391s


I've added a simple script which compiles scripts blender uses, run
using this command:
  blender.bin --background --python source/tools/compile_scripts.py


The question is when should this run?, since scons is used for release
perhaps this should be part of the packaging process?

-- 
- Campbell


More information about the Bf-committers mailing list