http://www.perlmonks.org?node_id=969922


in reply to Re: Is it possible to find the number of matching and non-matching positions in strings using perl code?
in thread Is it possible to find the number of matching and non-matching positions in strings using perl code?

Nice explanation++.

One minor change: s/binary operations are faster than looping over all characters/looping over the characters in C is faster than looping over the characters in Perl/


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".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

  • Comment on Re^2: Is it possible to find the number of matching and non-matching positions in strings using perl code?

Replies are listed 'Best First'.
Re^3: Is it possible to find the number of matching and non-matching positions in strings using perl code?
by Jenda (Abbot) on May 11, 2012 at 08:38 UTC

    The question is whether or how much C-level looping is there actually. Some CISC processors include string operators so the XOR might actually be a single instruction.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      Some CISC processors include string operators so the XOR might actually be a single instruction.

      They still loop, just at the microcode level.

      There is always a conditional test; address register(s) get incremented; and often a count register gets decremented; for some number of repetitions or until some condition is met. It's still a 'loop' by any standard.


      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".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

        Sure it's a loop. That's why I wrote "C-level loop". And you spoke about looping in C as well :-)

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.