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: 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: References: From: Vincent Davis 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" 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: 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 --001a11c30ce2e0f9c104f0ab2284 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=E2=80=8B This took ~20 secs vs .480*10 d(4, 14) takes about 24 seconds (one run) Vincent Davis --001a11c30ce2e0f9c104f0ab2284 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Thu, Jan 23, 2014 at 3:15 PM, Peter Otten <__peter__@web.de> wrote:
$ python -m tim= eit -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&= #39;
'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 examp= le
$ 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 m= ore that 10*.0102 Why is this?

$ python3 -m timeit -s 'from d= ebruijn_compat import debruijn_bytes as d' 'd(4, 11)'
10 loops, b= est of 3: 480 msec per loop=E2=80=8B
This took ~20 = secs vs .480*10

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

Vincent Davis

--001a11c30ce2e0f9c104f0ab2284--