Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87017

Re: Speeding up permutations generation

Path csiph.com!usenet.pasdenom.info!news.redatomik.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 <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'talks': 0.03; 'say,': 0.05; 'problem?': 0.07; 'lawrence': 0.09; 'replied': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterating': 0.16; 'subject:generation': 0.16; 'thread,': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'memory': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'post': 0.26; 'header :In-Reply-To:1': 0.27; 'rest': 0.29; 'message-id:@mail.gmail.com': 0.30; 'went': 0.31; 'code': 0.31; 'usually': 0.31; 'about.': 0.31; 'bad.': 0.31; 'fri,': 0.33; 'guess': 0.33; 'programmers': 0.33; 'actual': 0.34; 'received:google.com': 0.35; 'wrong': 0.37; 'two': 0.37; 'list': 0.37; 'pm,': 0.38; 'expect': 0.39; 'extremely': 0.39; 'generating': 0.39; 'even': 0.60; 'read': 0.60; 'most': 0.60; 'hope': 0.61; 'mentioned': 0.61; 'simply': 0.61; "you're": 0.61; 'back': 0.62; 'mar': 0.68; '2015': 0.84; 'itertools,': 0.84; 'measure.': 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=iN41h6ofaKRjZRuVFqC4P5plPUQhyUjE9pHTvqTy97U=; b=frCP4MfoTZ1nTLQKUUFD2C4XelmXBvBZPcEuXageyCzi4v3dnvKi7m/yP/rSlxDrP7 3WxFgBKBguZKec/2SkZ+g8qPmEAtpy8JlXahxDzR4QbVAqos9TnkYhev7Lab9wG7TzXx EintPQRDOeo7Tp2A43QK9uX2XYSwQ+Wk9p9m2qsmegZleYykoApzA04vBj7YlrtEukQe ydUqWiQ+16oUQtrH3I+jxGyec8x2WXpNwr7osWxkwsJNwBZr2QDsTZwJGq1O4BXs8hjH IZ7GPmyDz6qXR4M42WSuEQItIffFZO/Pl68Dq9jQuGAqZatnfZv5T579ppJvj66GYPJw IGAA==
MIME-Version 1.0
X-Received by 10.50.131.196 with SMTP id oo4mr27577221igb.2.1425643355374; Fri, 06 Mar 2015 04:02:35 -0800 (PST)
In-Reply-To <mdbvp0$rl2$1@ger.gmane.org>
References <CADgpKWb=q2=YEJSS1yRkgzF37nO5BNRnywm+zhcwF-MAOr6MdA@mail.gmail.com> <CALwzid=O96Jd_bwwgxOuswmW9ucoFh=4Ht1P1Msrb7POZij__w@mail.gmail.com> <CADgpKWaJkyO8yCPmTSphGjPBaCWcNUpJOwDdb7tJ-hNHPTMf4A@mail.gmail.com> <CAPTjJmpwkd107nHnOoba19oe8wg16bYxW7J1LC-Y7=Mbc64=BA@mail.gmail.com> <mdbvp0$rl2$1@ger.gmane.org>
Date Fri, 6 Mar 2015 23:02:35 +1100
Subject Re: Speeding up permutations generation
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.19
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.107.1425643363.21433.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1425643363 news.xs4all.nl 2876 [2001:888:2000:d::a6]:39065
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:87017

Show key headers only | View raw


On Fri, Mar 6, 2015 at 9:33 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
>> Is the actual generation of permutations your problem? You mentioned
>> that you're using itertools, so I would expect that you're simply
>> iterating over that; I hope you're not immediately trying to construct
>> a list of them all, because that would cost the memory that Mark's
>> response talks about. Have you actually profiled your code and found
>> that generating permutations is the bottleneck, or did you just guess?
>> Because even experienced programmers - even extremely experienced
>> Python programmers - are usually wrong when they guess about the
>> slowest part of a program. The only way to know is to measure.
>>
>> ChrisA
>>
>
> s/Mark/Wolfgang/ ?

Oops, yes, my bad. I read the rest of the thread, then went back up
and replied to the most appropriate post for what I wanted to say, and
then named the wrong person out of the two following posters. My
apologies, Mark and Wolfgang!

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Speeding up permutations generation Chris Angelico <rosuav@gmail.com> - 2015-03-06 23:02 +1100

csiph-web