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


Groups > comp.lang.python > #64641

Re: generate De Bruijn sequence memory and string vs lists

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <vincent@vincentdavis.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; '480': 0.05; 'python3': 0.07; 'subject:string': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; "'from": 0.16; '23,': 0.16; 'to:addr:web.de': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'example': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'sense': 0.34; 'received:209.85': 0.35; 'subject:lists': 0.35; 'received:google.com': 0.35; 'seconds': 0.37; 'received:209': 0.37; 'question,': 0.38; 'pm,': 0.38; 'reported': 0.39; 'took': 0.61; 'times': 0.62; 'more': 0.64; '100': 0.79; '10.2': 0.84; 'otten': 0.84; 'received:209.85.214.181': 0.84; 'received:mail- ob0-f181.google.com': 0.84
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=UthF4fPKGYRxMxxzO1K/O1jjkLPu2LFpkWUXB87nFZ0=; b=ME89/mBFJiHd5JW2CFAJITM1jJjzpUoh9KUJ0AP33wOX+MBOAhGLN2pfWbkZSBu+df LwJYRGyPgf6nWKuoJ5yqpOvY9OCq4Ld75xbDxi9NwWfeDUqj3txIhpROSTmQWLB2WJy5 lXzhYhnXZnAoIV0uoU5YbZABPNltM9NTIDsrESRlM6wtmN/5f1pYsjK7GTzpfaEWoBW5 zDLtLrCl3FVRRVu0v4uReI0Iz0JyhyKGXMcyRc9KftFlGvj5cTmOnsPjV2e69TBVAZHR lB5BywobJIs9youAJhGjvAZ/K6yeTimf20lf0CNFqez33ZBO1ZnJ4oVPxvBZCfFyGHLC FR/A==
X-Gm-Message-State ALoCoQkBXjI8Qwn/fyGdfhzRW+soFtN6GTJmFT62B3QgBO54SJ1ZpVUys1Re82GFqnPm7z/U5Uz/
X-Received by 10.182.43.161 with SMTP id x1mr9304129obl.5.1390517722079; Thu, 23 Jan 2014 14:55:22 -0800 (PST)
MIME-Version 1.0
In-Reply-To <lbs0nm$f4t$1@ger.gmane.org>
References <CALyJZZVU+j64Jn7fqqzLmwW+KcM=43UMKjo=HW7umnq8MSP2Uw@mail.gmail.com> <lbrjjq$96p$1@ger.gmane.org> <lbrlel$vpq$1@ger.gmane.org> <CALyJZZUn4XvTHSnsJhQwsM7CyXUJJis_BwwoZ8EYAQ209bvfig@mail.gmail.com> <lbrst6$vel$1@ger.gmane.org> <lbrugd$k3a$1@ger.gmane.org> <CALyJZZU2J3n67LwF1a2-6eeMZ=J18zbj8h+QV-w7Ujz=kHkgOw@mail.gmail.com> <lbs0nm$f4t$1@ger.gmane.org>
From Vincent Davis <vincent@vincentdavis.net>
Date Thu, 23 Jan 2014 16:55:01 -0600
Subject Re: generate De Bruijn sequence memory and string vs lists
To Peter Otten <__peter__@web.de>
Content-Type multipart/alternative; boundary=001a11c30ce2e0f9c104f0ab2284
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.5914.1390517726.18130.python-list@python.org> (permalink)
Lines 100
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390517726 news.xs4all.nl 2978 [2001:888:2000:d::a6]:33656
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64641

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Jan 23, 2014 at 3:15 PM, Peter Otten <__peter__@web.de> wrote:

> $ python -m timeit -s 'from debruijn_compat import debruijn as d' 'd(4, 8)'
> 10 loops, best of 3: 53.5 msec per loop
> $ python -m timeit -s 'from debruijn_compat import debruijn_bytes as d'
> 'd(4, 8)'
> 10 loops, best of 3: 22.2 msec per loop
> $ python3 -m timeit -s 'from debruijn_compat import debruijn as d' 'd(4,
> 8)'
> 10 loops, best of 3: 68 msec per loop
> $ python3 -m timeit -s 'from debruijn_compat import debruijn_bytes as d'
> 'd(4, 8)'
> 10 loops, best of 3: 21.7 msec per loop
>

Excellent Peter!
I have a question, the times reported don't make sense to me, for example
$ python3 -m timeit -s 'from debruijn_compat import debruijn_bytes as d'
'd(4, 8)'
100 loops, best of 3: 10.2 msec per loop
This took ~4 secs (stop watch) which is much more that 10*.0102 Why is this?

$ python3 -m timeit -s 'from debruijn_compat import debruijn_bytes as d'
'd(4, 11)'
10 loops, best of 3: 480 msec per loop​
This took ~20 secs vs .480*10

d(4, 14) takes about 24 seconds (one run)

Vincent Davis

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


Thread

Re: generate De Bruijn sequence memory and string vs lists Vincent Davis <vincent@vincentdavis.net> - 2014-01-23 16:55 -0600

csiph-web