Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.06; 'found,': 0.07; 'paths': 0.07; 'tries': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:2.7': 0.09; 'subject:files': 0.09; 'python': 0.11; 'jan': 0.12; '.py': 0.16; 'exhaustive': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'sure.': 0.16; 'sys.path': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'seems': 0.21; 'issue.': 0.22; 'header:User- Agent:1': 0.23; 'directory.': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'needed.': 0.30; "i'm": 0.30; 'extensively': 0.31; 'loading': 0.31; 'file': 0.32; 'figure': 0.32; 'guess': 0.33; 'maybe': 0.34; 'could': 0.34; 'but': 0.35; 'there': 0.35; 'hi,': 0.36; 'behind': 0.37; 'application': 0.37; 'minimum': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'issue': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:173': 0.61; 'more': 0.64; 'minutes': 0.67; 'received:fios.verizon.net': 0.84; 'reducing': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Python 2.7 importing pyc files without py files Date: Wed, 19 Feb 2014 17:26:02 -0500 References: <8a6aff2d-777a-4f80-8c26-6d1a586e6c5c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <8a6aff2d-777a-4f80-8c26-6d1a586e6c5c@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392848807 news.xs4all.nl 2913 [2001:888:2000:d::a6]:39379 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66723 On 2/19/2014 5:03 PM, Mircescu Andrei wrote: > Hi, > > > I encountered a strange issue. I have an application which uses > extensively python 2.7.6 (CPython). > > > The issue that I see is the following: If there are only pyc files, > the loading time of the application is much more than if I have pyc > and py files. It is behind with 2 minutes more than if it had py > files > > Do you have any idea why this is happening ? Maybe is because, python > tries to search the py file in all the paths and this search is > exhaustive ? This is the best guess I could figure it out but I'm not > sure. It seems plausible. Once .py is found, the .pyc is in the same directory. > Also, if this is the scenario, there is a way I can stop this, to not > search for the py files ? Try reducing sys.path to the minimum needed. -- Terry Jan Reedy