Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^7: [OT] The interesting problem of comparing bit-strings.

by salva (Canon)
on Mar 25, 2015 at 12:23 UTC ( [id://1121298]=note: print w/replies, xml ) Need Help??


in reply to Re^6: [OT] The interesting problem of comparing bit-strings.
in thread [OT] The interesting problem of comparing bit-strings.

locating a 1Mi bit needle near the end of a 1GiB buffer of random bits

Have you considered that using random test data may not be a good idea. You are never going to generate the performance-degrading worst cases.

For instance, it is very unlikely that you will find partial needle matches longer than a few bits.

  • Comment on Re^7: [OT] The interesting problem of comparing bit-strings.

Replies are listed 'Best First'.
Re^8: [OT] The interesting problem of comparing bit-strings.
by BrowserUk (Patriarch) on Mar 25, 2015 at 12:45 UTC
    Have you considered that using random test data may not be a good idea.

    I'm not really at the testing stage.

    Still trying to cover off the edge cases without upsetting the compiler's ability to maintain the important values in registers, to avoid reloading values from memory.

    The difference in performance between /Od (none) and /Ox (full) is currently over an order of magnitude -- about as big a difference as I ever recall seeing -- and I think I might be able to get two orders if I can move some of the conditional stuff out of the critical path; but it is all too easy to upset things badly by adding an extra test or two. (And I need an extra condition or two :()

    For instance, it is very unlikely that you will find partial needle matches longer than a few bits.

    Currently I'm generating a haystack of random quads and then extracting a needle of a specified size and (0..62) bit-offset from within that, somewhere close to the end.

    This means I not only know that the needle exists, but where it should be found. More importantly, if it isn't found, then I can quickly detect patterns in the combinations of parameters that cause it to fail.

    For example, it currently handles leading bit offsets, but not non-multiples of 64-bits. And that's because I tried (unsuccessfully) to move the terminating condition out of the main path of the code.


    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1121298]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found