in reply to Re^11: [OT] The interesting problem of comparing (long) bit-strings.
in thread [OT] The interesting problem of comparing bit-strings.

I can continue to explain my reasoning; and you can continue to state your beliefs till we're both blue in the face.

Blah! Prove it!

  • Comment on Re^12: [OT] The interesting problem of comparing (long) bit-strings.

Replies are listed 'Best First'.
Re^13: [OT] The interesting problem of comparing (long) bit-strings.
by salva (Canon) on Mar 31, 2015 at 13:12 UTC
    # $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

      And what do the numbers look like if the offset is 99999997 and the length 2003?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
        $ for i in 99999996 99999997 99999998 99999999; do for j in 1999 2001 +2002 2003 2004; do echo $i $j; ./bitstrstr test.dat $i $j 100; done; +done 99999996 1999 needle found at 99999996, expected at 99999996 in 11.7/100 = 0.117ms 99999996 2001 needle found at 99999996, expected at 99999996 in 11.7/100 = 0.117ms 99999996 2002 needle found at 99999996, expected at 99999996 in 11.6/100 = 0.116ms 99999996 2003 needle found at 99999996, expected at 99999996 in 12.1/100 = 0.121ms 99999996 2004 needle found at 99999996, expected at 99999996 in 12/100 = 0.12ms 99999997 1999 needle found at 99999997, expected at 99999997 in 11.5/100 = 0.115ms 99999997 2001 needle found at 99999997, expected at 99999997 in 13.2/100 = 0.132ms 99999997 2002 needle found at 99999997, expected at 99999997 in 11.5/100 = 0.115ms 99999997 2003 needle found at 99999997, expected at 99999997 in 11.8/100 = 0.118ms 99999997 2004 needle found at 99999997, expected at 99999997 in 11.6/100 = 0.116ms 99999998 1999 needle found at 99999998, expected at 99999998 in 911.9/100 = 9.119ms 99999998 2001 needle found at 99999998, expected at 99999998 in 12.2/100 = 0.122ms 99999998 2002 needle found at 99999998, expected at 99999998 in 13.2/100 = 0.132ms 99999998 2003 needle found at 99999998, expected at 99999998 in 11.7/100 = 0.117ms 99999998 2004 needle found at 99999998, expected at 99999998 in 12.6/100 = 0.126ms 99999999 1999 needle found at 99999999, expected at 99999999 in 12/100 = 0.12ms 99999999 2001 needle found at 99999999, expected at 99999999 in 912.1/100 = 9.121ms 99999999 2002 needle found at 99999999, expected at 99999999 in 12.5/100 = 0.125ms 99999999 2003 needle found at 99999999, expected at 99999999 in 12.6/100 = 0.126ms 99999999 2004 needle found at 99999999, expected at 99999999 in 12.2/100 = 0.122ms