Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'interpreter.': 0.07; 'dan': 0.09; 'imported': 0.09; 'restart': 0.09; 'subject:modules': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; '24,': 0.16; 'afterwards': 0.16; 'cc:name:python list': 0.16; 'exiting': 0.16; 'guessing': 0.16; 'simplicity,': 0.16; 'sure.': 0.16; 'sys.modules': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'module': 0.19; 'import': 0.22; 'reset': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'script.': 0.24; "haven't": 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'too.': 0.31; '25,': 0.31; 'staying': 0.31; 'subject:some': 0.31; 'stuff': 0.32; 'running': 0.33; 'beginning': 0.33; 'maybe': 0.34; 'could': 0.34; 'created': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'next': 0.36; 'performance': 0.37; 'easiest': 0.38; 'pm,': 0.38; 'help,': 0.39; 'truly': 0.60; 'affect': 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'within': 0.65; '2015': 0.84; '^_^': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+rp42iaVY4tBC3yRqEAuwd8EBgYRZfRgzrQRI9KGC0Y=; b=laYhKM4DpK3jjVaP1BvlzZF1p6VoXBlWBx30nmm8konav26tPoQN8tMr7XCRxocIOL DUIdGwsUx30x9iFtnG7LXRFs0QjaEEzEGqdmjWhEbAj7WYc7VTRVHPEDiiNET8DNwKrA OjrL16EQtv46ps25qKxzW0Q585Apd5q9s+wb683SFcYAOYHN4a1GUeqpueSptkDggLTd yJCg1vwdEIcg1RwWgrIKXej/NBsuCoUB4YuWqo2VPLMUu4h5lIhKQXYcGHPqssSNhrA+ DxRr07lh5A25jVGDADNuDxUKG0ffACXrv5U1L7d/MF2O6e5NgVEqvnDdZ1WCntKP6O77 N1WA== MIME-Version: 1.0 X-Received: by 10.112.252.42 with SMTP id zp10mr14718108lbc.51.1422153361500; Sat, 24 Jan 2015 18:36:01 -0800 (PST) In-Reply-To: References: Date: Sat, 24 Jan 2015 18:36:01 -0800 Subject: Re: Benchmarking some modules - strange result From: Dan Stromberg To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: Python List 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422153367 news.xs4all.nl 2829 [2001:888:2000:d::a6]:38953 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84544 On Sat, Jan 24, 2015 at 6:24 PM, Chris Angelico wrote: > On Sun, Jan 25, 2015 at 1:11 PM, Dan Stromberg wrote: >> For simplicity, let's say I've been running the suite of performance >> tests within a single interpreter - so I test one module thoroughly, >> then move on to the next without exiting the interpreter. >> [chomp more details] > > Do the modules import stuff that's staying imported? That could > majorly affect performance. What about .pyc files? The modules are all imported up at the top of the script. I haven't verified this, but I'm guessing the .pyc's are created at the beginning too. > I don't know if you can truly reset the interpreter. Snapshotting > sys.modules and reinstating it afterwards would help, but there are > other concerns too. I would personally just restart the interpreter > each time, frankly; it's the easiest way to be sure. Maybe so ^_^