Il giorno 07/giu/2012, alle ore 22:21, Hartmut Goebel ha scritto:

> Am 07.06.2012 19:06, schrieb Giovanni Bajo:
>> 
>> why does PyInstaller.utils.git try to parse the .git directory and then 
>> fallbacks to git rev-parse? 
> 
> Because calling a subprocess is an expensive operation and 
> get_repo_revision() is called on *every* invocation or import of PyInstaller. 
> So if you are going to always subprocess git, you should find an different 
> way for building the version-number in PyInstaller/__init__.py

Using .git format parsing:

rasky@breathe:~/Sources/pyinstaller$ time python git.py 
8f7eccd

real    0m0.075s
user    0m0.052s
sys     0m0.021s


Using git subprocess:

rasky@breathe:~/Sources/pyinstaller$ time python git.py 
8f7eccd

real    0m0.082s
user    0m0.055s
sys     0m0.025s


I doubt a 7 ms increase in PyInstaller execution time is something we should be 
worried about. I've removed the code, less code is less bugs.
-- 
Giovanni Bajo   ::  [email protected]
Develer S.r.l.  ::  http://www.develer.com

My Blog: http://giovanni.bajo.it


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to