Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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; 'subject:not': 0.03; 'tree': 0.05; 'subject:Python': 0.06; 'ugly': 0.07; 'agree,': 0.09; 'exception.': 0.09; 'fashion.': 0.09; 'overflow': 0.09; 'cc:addr:python-list': 0.11; 'lend': 0.16; 'limit.': 0.16; 'trampoline': 0.16; 'wrote:': 0.18; 'stack': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; '>': 0.26; 'nearly': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'evil': 0.31; 'trivial': 0.31; 'themselves': 0.32; 'run': 0.32; 'quite': 0.32; 'worked': 0.33; 'url:python': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'url:listinfo': 0.36; 'similar': 0.36; 'url:org': 0.36; 'christian': 0.38; 'problems': 0.38; 'issue': 0.38; 'url:mail': 0.40; 'helps': 0.61; 'myself': 0.63; '(probably': 0.84; '2015': 0.84; 'iterative': 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=vzKZ+DTyKVjalnNL0l+WPYpoGImD07YUcXeU4+pnVBk=; b=nvuWE8MVJzJMsKghn+dhlNAryzwjlGyR+DOiKo+m1nlo2EKjv6wxayTl0HkN79BHvs doCf5W0dIojYcSSccqAHEO0+cQpY3BRLiQcoJYAf14JnKoUHRkwIqI7JPKm8A1OWcod9 JnUTGtEodP+kOUlNCG3Ht9P+7zx7EehibL5HSEsi/Bl5q4gQBA1SjaLhjfRJtKC185fp 62WBfVCAZXAycn4vAVdePJzTjcfatmjz3Yhdi/OzctI42GMQ9Ihbr4KUAHvbPg5EucWN StbxqzAexKjy2K1JEegvBkAnKbKOBkXHimifOsvA2pCkCNYkb8T5pp3FjQ/dx4uls58W SnEw== MIME-Version: 1.0 X-Received: by 10.107.19.2 with SMTP id b2mr18593165ioj.9.1430574658578; Sat, 02 May 2015 06:50:58 -0700 (PDT) In-Reply-To: <87383fkxy0.fsf@elektro.pacujo.net> References: <87mw1q9jqw.fsf@Equus.decebal.nl> <87383hj4zj.fsf@elektro.pacujo.net> <87d22lx38x.fsf@Equus.decebal.nl> <55432557$0$12994$c3e8da3$5496439d@news.astraweb.com> <87383fo062.fsf@Equus.decebal.nl> <87egmzl4yr.fsf@elektro.pacujo.net> <87a8xnl2r6.fsf@elektro.pacujo.net> <87383fkxy0.fsf@elektro.pacujo.net> Date: Sat, 2 May 2015 16:50:58 +0300 Subject: Re: Python is not bad ;-) From: Joonas Liik To: Marko Rauhamaa Cc: python-list@python.org Content-Type: multipart/alternative; boundary=001a113f2af6596dfa0515199e76 X-Mailman-Approved-At: Sat, 02 May 2015 18:53:38 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 69 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430585619 news.xs4all.nl 2914 [2001:888:2000:d::a6]:52863 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89779 --001a113f2af6596dfa0515199e76 Content-Type: text/plain; charset=UTF-8 I agree, stack overflow is literally the main issue that ive run in to (tree traversal) I've yet to refactor recursion to iterative for speed, but i have done so to avoid hitting the stack size limit. Tree traversal and similar problems in particular lend themselves well to recursion and are not quite as trivial to do in an iterative fashion. I've also found myself constructing an ad-hoc trampoline at least once just to sneak past the stack limit. (probably very evil but it worked and it wasn't nearly as ugly as it sounds like so ill live with it..) On 2 May 2015 at 14:42, Marko Rauhamaa wrote: > Christian Gollwitzer : > > > That's why I still think it is a microoptimization, which helps only > > in some specific cases. > > It isn't done for performance. It's done to avoid a stack overflow > exception. > > > Marko > -- > https://mail.python.org/mailman/listinfo/python-list > --001a113f2af6596dfa0515199e76 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I agree, stack overflow is literally the main issue that i= ve run in to (tree traversal)
I've yet to refactor recursion to ite= rative for speed, but i have done so to avoid hitting the stack size limit.=

Tree traversal and similar problems in particular= lend themselves well to recursion and are not quite as trivial to do in an= iterative fashion.

I've also found myself con= structing an ad-hoc trampoline at least once just to sneak past the stack l= imit.
(probably very evil but it worked and it wasn't nearly = as ugly as it sounds like so ill live with it..)

<= /div>

On 2 M= ay 2015 at 14:42, Marko Rauhamaa <marko@pacujo.net> wrote:
Christian Gollwitzer <auriocus@gmx.de>:

> That's why I still think it is a microoptimization, which helps on= ly
> in some specific cases.

It isn't done for performance. It's done to avoid a stack ov= erflow
exception.


Marko
--
https://mail.python.org/mailman/listinfo/python-list

--001a113f2af6596dfa0515199e76--