# $file $needle_bit_offset $needle_bit_length $repetitio +ns ./bitstrstr test.dat 100000000 2000 +10 needle found at 100000000, expected at 100000000 in 1.6/10 = 0.16ms

Update:

$ for i in 16 20 30 40 60 100 200 400 1000 3000 10000; do echo $i; ./b +itstrstr test.dat 100000000 $i 10; done 16 needle found at 164016, expected at 100000000 in 1.1/10 = 0.11ms 20 needle found at 949378, expected at 100000000 in 1.8/10 = 0.18ms 30 needle found at 100000000, expected at 100000000 in 1018.4/10 = 101.84 +ms 40 needle found at 100000000, expected at 100000000 in 38/10 = 3.8ms 60 needle found at 100000000, expected at 100000000 in 924.1/10 = 92.41ms 100 needle found at 100000000, expected at 100000000 in 12/10 = 1.2ms 200 needle found at 100000000, expected at 100000000 in 6.2/10 = 0.62ms 400 needle found at 100000000, expected at 100000000 in 3.7/10 = 0.37ms 1000 needle found at 100000000, expected at 100000000 in 2.3/10 = 0.23ms 3000 needle found at 100000000, expected at 100000000 in 0.9/10 = 0.09ms 10000 needle found at 100000000, expected at 100000000 in 0.4/10 = 0.04ms

In reply to Re^13: [OT] The interesting problem of comparing (long) bit-strings. by salva
in thread [OT] The interesting problem of comparing bit-strings. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.