Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.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.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'fixes': 0.07; 'tool,': 0.07; 'latter': 0.09; 'cc:addr:python-list': 0.11; 'both,': 0.16; 'camp:': 0.16; 'enough.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'magic': 0.16; 'other,': 0.16; 'tool.': 0.16; 'true:': 0.16; 'appropriate': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'error': 0.23; 'cc:2**0': 0.24; 'nearly': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'view.': 0.31; 'class': 0.32; 'quite': 0.32; 'third': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'too': 0.37; 'problems': 0.38; 'pm,': 0.38; 'solve': 0.60; 'break': 0.61; 'strictly': 0.61; 'more': 0.64; 'truth': 0.81; 'dust': 0.84; 'everything,': 0.84; 'everything.': 0.84; 'notion': 0.91; 'prone': 0.91; '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=udZ3zn+7rFtJm20fN2w8ElBJvCoN4oL2tuowY0iKiIM=; b=lOpO1Tmaq+AdYYRsGdNxGZ9+Jc9xJn2GYsJtYFZJ3GF9uQgopXpmuu4nazb3KxNWRu btlKLSf3rL5ixvnEHNYlgPBm3mhrr1lyA4nOGmZXJ03Az0A1/l5Z1c4c0uyQebdeSrdT +AzWUu3ID+X0pfNU8i7gk1Fg9wnkj4z37WthRJUnQwa2INuCsDNFfE8Wzc4SdkE8pbrs A13/bI7T96LWIRJ1NkYaupV3ChSFuCHTBeEYLIgk52jW+OMTuBSphuYnyU05cQHd/dxH CQM/VNbPak3GmP/4+DmLpniV2gSv8IXC/FMbEPXF5hk3c3q2V4lGM5i1hKtCd0kTmZnu swDw== MIME-Version: 1.0 X-Received: by 10.52.171.18 with SMTP id aq18mr5593315vdc.45.1404009161674; Sat, 28 Jun 2014 19:32:41 -0700 (PDT) In-Reply-To: References: <53acdd24$0$29985$c3e8da3$5496439d@news.astraweb.com> <87wqc0hmdo.fsf@elektro.pacujo.net> Date: Sun, 29 Jun 2014 12:32:41 +1000 Subject: Re: print statements and profiling a function slowed performance From: Chris Angelico Cc: "python-list@python.org" 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404009170 news.xs4all.nl 2914 [2001:888:2000:d::a6]:40665 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73721 On Sun, Jun 29, 2014 at 12:25 PM, Rustom Mody wrote: > On Sunday, June 29, 2014 12:50:19 AM UTC+5:30, Marko Rauhamaa wrote: >> Chris Angelico wrote: > >> > Threading is a focus of so many myths. People who don't understand it >> > think that threads are magic pixie dust that fixes everything, or else >> > magic pixie dust that breaks everything. Or both, at the same time. >> > Neither notion is true. > >> I'm in the latter camp. > >> More precisely: threads have their uses but they are used far too much >> and not feared nearly enough. > > Third Camp: > Since both views are true: > > Chris: Threads solve a large class of important problems > Marko: Threads are horribly error prone Not strictly my view. I said that both extremes ("threads fix everything" and "threads break everything") are quite wrong; the truth is that threading is a tool, like any other, and you have to know when it's appropriate to use each tool. ChrisA