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


Groups > comp.lang.python > #64641 > unrolled thread

Re: generate De Bruijn sequence memory and string vs lists

Started byVincent Davis <vincent@vincentdavis.net>
First post2014-01-23 16:55 -0600
Last post2014-01-23 16:55 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#64641 — Re: generate De Bruijn sequence memory and string vs lists

FromVincent Davis <vincent@vincentdavis.net>
Date2014-01-23 16:55 -0600
SubjectRe: generate De Bruijn sequence memory and string vs lists
Message-ID<mailman.5914.1390517726.18130.python-list@python.org>

[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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web