Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'interpreter': 0.05; 'interpreter.': 0.07; 'dan': 0.09; 'restart': 0.09; 'subject:modules': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'afterwards': 0.16; 'cc:name:python list': 0.16; 'exiting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'simplicity,': 0.16; 'sure.': 0.16; 'sys.modules': 0.16; 'wrote:': 0.18; 'module': 0.19; 'import': 0.22; 'reset': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'too.': 0.31; '25,': 0.31; 'staying': 0.31; 'subject:some': 0.31; 'stuff': 0.32; 'running': 0.33; 'could': 0.34; '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; 'within': 0.65; '2015': 0.84; 'to:none': 0.92 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:cc :content-type; bh=NmptwX+P4tKbC8CkayW4BwaPTKrf8VFbZ9Xh4VvqWc4=; b=mzS1USlsJoVOxa4DK9krsBeggrVixDrew9yBwbnkNeEOkbI5GRYo273GSjPBvnmTHR ATgVQkKPqfh2Qj2brIXmTrrcZia67k/7Lqf+NzDk+QozwiVJbJKBxBNssDX7bi4bPWDo 08BZrRYi5TdWjgHnfhD+SfPyrWILvUz84rzwR2Xi2idMtwRrRUa3o/U2/R0wQFirAKfP kclaxRTnpXJZvDPO1jfDMGXfXMgjW22N90Ctk98HlCdhheAKmxcpAvxCg+1KJS2By/3X nKESEy+Q/YstiZ3DzpPk2uMiWOL4U627PZ0ph+FsiwnCS5F26a1XvgA18muWMGnV7N2I JcUA== MIME-Version: 1.0 X-Received: by 10.107.167.201 with SMTP id q192mr385146ioe.43.1422152666009; Sat, 24 Jan 2015 18:24:26 -0800 (PST) In-Reply-To: References: Date: Sun, 25 Jan 2015 13:24:25 +1100 Subject: Re: Benchmarking some modules - strange result From: Chris Angelico Cc: Python List Content-Type: text/plain; charset=UTF-8 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422152675 news.xs4all.nl 2934 [2001:888:2000:d::a6]:57772 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84541 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? 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. ChrisA