Re: [Python-Dev] Embedded Python startup is slow

2011-03-25 Thread Victor Stinner
Le jeudi 24 mars 2011 à 22:40 -0400, R. David Murray a écrit : > On Fri, 25 Mar 2011 01:20:34 +0100, Paul Boddie wrote: > > Since this topic has come up a few times before, I thought it might be time > > to > > collect references to it as well as to other topics that people doing > > embedded w

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread R. David Murray
On Fri, 25 Mar 2011 01:20:34 +0100, Paul Boddie wrote: > Since this topic has come up a few times before, I thought it might be time > to > collect references to it as well as to other topics that people doing > embedded work might be interested in, along with the recurring problems that > see

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Paul Boddie
bruce bushby wrote: > > My main concern was that a freshly compiled Python attempts to open 168 > non-existent files before starting. This has been a longstanding problem with CPython and, despite assertions to the contrary, a significant factor on some embedded systems. > I understand that an i

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Martin v. Löwis
> My main concern was that a freshly compiled Python attempts to open 168 > non-existent files before starting. Please consider my proposals then. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Santoso Wijaya
On Thu, Mar 24, 2011 at 9:18 AM, James Y Knight wrote: > On Mar 24, 2011, at 11:58 AM, bruce bushby wrote: > > My main concern was that a freshly compiled Python attempts to open 168 > non-existent files before starting. > > > > I understand that an interpreted language is probably not the best c

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Stefan Behnel
bruce bushby, 24.03.2011 18:39: On Thu, Mar 24, 2011 at 5:05 PM, Stefan Behnel wrote: bruce bushby, 24.03.2011 16:58: On my desktop pc, when I run the most simple "Hello World" 78% of the overall execution time is spent opening filesmost of which don't exist. How did you measure th

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread bruce bushby
I used the most simple "Hello World" program as a benchmark for "bare bones" Python __initialization__...nothing more. On my pc, the "Hello World" script obviously executes very quicklyso trying to open 160 odd files that don't exist is negligible, but it still happens. "...How did you measu

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Stefan Behnel
bruce bushby, 24.03.2011 16:58: My main concern was that a freshly compiled Python attempts to open 168 non-existent files before starting. I understand that an interpreted language is probably not the best choice for an embedded device Well, "hello world" isn't exactly the benchmark I'd use f

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread James Y Knight
On Mar 24, 2011, at 11:58 AM, bruce bushby wrote: > My main concern was that a freshly compiled Python attempts to open 168 > non-existent files before starting. > > I understand that an interpreted language is probably not the best choice for > an embedded device (although it's very nice for p

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread bruce bushby
".your Desktop PC being that MS-Windows..." ww sis man, it's all Linux : I wanted to make sure I've not missed some compile trick for this sort of thing. ".So maybe you should try to come up with a patch, to find out if the cache helps?" Yes, now that I know I've not ignored some

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Thomas Heller
Am 24.03.2011 16:58, schrieb bruce bushby: My main concern was that a freshly compiled Python attempts to open 168 non-existent files before starting. I understand that an interpreted language is probably not the best choice for an embedded device (although it's very nice for prototyping) , Pyt

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread bruce bushby
My main concern was that a freshly compiled Python attempts to open 168 non-existent files before starting. I understand that an interpreted language is probably not the best choice for an embedded device (although it's very nice for prototyping) , Python really should know what exists after it's

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Thomas Heller
Am 24.03.2011 12:18, schrieb "Martin v. Löwis": 1. Is there anything I can do at compile time to tell Python these files don't exist and avoid trying to open them? If you disable dynamic loading of extension modules, the number of stat calls will go down significantly. 2. Is it possible to ma

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Martin v. Löwis
> 1. Is there anything I can do at compile time to tell Python these files > don't exist and avoid trying to open them? If you disable dynamic loading of extension modules, the number of stat calls will go down significantly. > 2. Is it possible to make python first try and open the ".pyc" and on

Re: [Python-Dev] Embedded Python startup is slow

2011-03-24 Thread Glyph Lefkowitz
On Mar 24, 2011, at 4:06 AM, bruce bushby wrote: > I have previously asked this question in python-list, however I think it > belongs here. As the saying goes, this list is for development of python, not with python. So it would be appropriate to make a suggestion as to some direction for Pyt

[Python-Dev] Embedded Python startup is slow

2011-03-24 Thread bruce bushby
Hi I have previously asked this question in python-list, however I think it belongs here. I'm running python 2.7.1 on an embedded Linux board and noticed it takes 1.8 seconds to execute the most simple "Hello World" script. Platform: cpu: 200Mhz ARM (ARM926EJ-) kernel: 2.6.38 uClibc: 0.92.1-rc2