Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Antoine Pitrou
On Wed, 16 Apr 2014 22:33:49 +0200 Christian Tismer wrote: > On 16/04/14 16:35, Antoine Pitrou wrote: > > On Wed, 16 Apr 2014 09:39:34 +0200 > > Christian Tismer wrote: > >> > >> I think in cases like hg command line scripts there is no need > >> to import site just for hg scripts. > > > > If yo

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Nick Coghlan
On 16 April 2014 16:33, Christian Tismer wrote: > > In my sense it would be silly if that full-blown app would suffer from > or relate to site at all, tho. Apps are meant to be self-contained. For better or for worse, Python applications like Mercurial are currently considered an integrated part

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Christian Tismer
On 16/04/14 16:35, Antoine Pitrou wrote: > On Wed, 16 Apr 2014 09:39:34 +0200 > Christian Tismer wrote: >> >> I think in cases like hg command line scripts there is no need >> to import site just for hg scripts. > > If you don't import site you won't be able to import Mercurial in most > cases.

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Antoine Pitrou
On Wed, 16 Apr 2014 09:39:34 +0200 Christian Tismer wrote: > > I think in cases like hg command line scripts there is no need > to import site just for hg scripts. If you don't import site you won't be able to import Mercurial in most cases. Also, talking about "scripts" is a bit silly here - Me

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Terry Reedy
On 4/16/2014 3:46 AM, Christian Heimes wrote: On 16.04.2014 04:35, Guido van Rossum wrote: Well, that's the part that does "import site". Anything that speeds up the code in Lib/site.py might help. :-) Antoine, Victor and me have implemented a couple of speed ups for "import site" already. I r

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Brett Cannon
On Apr 16, 2014 3:47 AM, "Christian Heimes" wrote: > > On 16.04.2014 04:35, Guido van Rossum wrote: > > Well, that's the part that does "import site". Anything that speeds up > > the code in Lib/site.py might help. :-) > > Antoine, Victor and me have implemented a couple of speed ups for > "import

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Christian Heimes
On 16.04.2014 04:35, Guido van Rossum wrote: > Well, that's the part that does "import site". Anything that speeds up > the code in Lib/site.py might help. :-) Antoine, Victor and me have implemented a couple of speed ups for "import site" already. I removed several unnecessary imports by rearrang

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-16 Thread Christian Tismer
Not trying to argue about Mercurial, but if a major amount of startup time is spent in site.py: I think in cases like hg command line scripts there is no need to import site just for hg scripts. Maybe that would improve things if those startup scripts avoid importing site? Or do they, already? c

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-15 Thread Guido van Rossum
Well, that's the part that does "import site". Anything that speeds up the code in Lib/site.py might help. :-) On Tue, Apr 15, 2014 at 5:23 PM, Terry Reedy wrote: > On 4/15/2014 5:26 PM, Brett Cannon wrote: > >> To finish my timing work I decided to see >> where Py_InitializeEx_Private() spends

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-15 Thread Terry Reedy
On 4/15/2014 5:26 PM, Brett Cannon wrote: To finish my timing work I decided to see where Py_InitializeEx_Private() spends its time. The following is a breakdown measured in microseconds running using -E: INIT: setlocale: 11 envvar: 2 random init: 2 interp creation: 15 thread creation: 6 GIL: 10

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-15 Thread Brett Cannon
On Tue, Apr 15, 2014 at 5:40 PM, Guido van Rossum wrote: > Are you going to post your code (or a link to it)? > I basically wrote a function that uses gettimeofday() and just calculates the delta between the calls. Greg Smith verified that I wasn't doing anything stupid. =) Anyway, the diff can

Re: [Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-15 Thread Guido van Rossum
Are you going to post your code (or a link to it)? On Tue, Apr 15, 2014 at 2:26 PM, Brett Cannon wrote: > To finish my timing work I decided to see where Py_InitializeEx_Private() > spends its time. The following is a breakdown measured in microseconds > running using -E: > > INIT: > setlocale:

[Python-Dev] Timing breakdown of Py_InitializeEx_Private()

2014-04-15 Thread Brett Cannon
To finish my timing work I decided to see where Py_InitializeEx_Private() spends its time. The following is a breakdown measured in microseconds running using -E: INIT: setlocale: 11 envvar: 2 random init: 2 interp creation: 15 thread creation: 6 GIL: 10 _Py_ReadyTypes(): 930 more types: 44 builti