Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Unexplained benchmark when using chop vs. chomp (or neither)

by sundialsvc4 (Abbot)
on Mar 08, 2018 at 03:44 UTC ( #1210498=note: print w/replies, xml ) Need Help??


in reply to Unexplained benchmark when using chop vs. chomp (or neither)

Although you appear to have made (thank you!) a diligent effort to present data to explain your point, I’m afraid that I see the various alternatives to be “apples and oranges.”   As I superficially review your four alternatives – and without expanding your post – I see what appears to be a “side-by-side comparison” of four very different algorithms.   Also, you neglect to place the three “Perl alternatives” (chomp, chop, neither ...) into the benchmark.   Could you please do that, and post the results as an additional comment to this thread?   Please show us 4 + 2 = 6 lines of benchmark-data.

(And if I “just missed it,” I apologize in advance.)

  • Comment on Re: Unexplained benchmark when using chop vs. chomp (or neither)

Replies are listed 'Best First'.
Re^2: Unexplained benchmark when using chop vs. chomp (or neither)
by Eily (Prior) on Mar 08, 2018 at 10:55 UTC

    four very different algorithms
    Well, benchmarking several times the same code and using the result to simulate a horse race is a legitimate use of Benchmark. But some people also use Benchmark to compare different algorithms that give the same result.

    Also, you neglect to place the three “Perl alternatives”
    As a matter of fact, since the issue is that the input data is modified by the chopping function, comparing them in the same run may have shown that all the variants gets faster when chop is called.

Re^2: Unexplained benchmark when using chop vs. chomp (or neither)
by stevieb (Abbot) on Mar 08, 2018 at 04:31 UTC

    Will OP posting the "three Perl alternatives" help you write code for them?

    Why don't you present a solution; that is what this place is about.

    I admit that I comprehend your attention-getting now, but don't you get sick of being shunned, spit and shit on all the time?

    Seriously; my brother just called me the other day. He's been a troll for many years across mostly sports forums. Nonetheless, he told me "Steve, I'm angry all the time. I just interject in ways that attempt to antagonize people. I need to stop."

    Can you stop, or at least start to "pretend" to speak in a way where your rhetoric appears like you're not just a political advisor?

    If you do get off on "trolling", have the balls to say it. If not, please let us know what 1992 product you still service, along with how you "consult" and "advise" software companies.

Re^2: Unexplained benchmark when using chop vs. chomp (or neither)
by BrowserUk (Pope) on Mar 08, 2018 at 10:30 UTC

    Please show us 4 to 6 lines of Perl code that compiles, runs and does something useful. Go on. Surprise me.


    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". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit
      "...4 to 6 lines of Perl code that compiles..."

      Mostly it is just a question of the his comments:

      perl -E 'say qq(I “just missed it,” I apologize in advance); // svc'

      Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        Bareword found where operator expected at -e line 1, near "// svc" (Missing operator before svc?) syntax error at -e line 1, near "// svc " Execution of -e aborted due to compilation errors.
        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1210498]
help
Chatterbox?
NodeReaper power washes the cellar floor

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2018-06-24 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?