Perl strict Benchmark

This is a Example-Benchmark about to turn off things you don’t need in Perl:

use Benchmark qw(:all) ;
cmpthese(-1, {
'dev'      => sub {my($x,$y) = (4,3); $x = $x/$y;},
'strict'   => sub {my($x,$y) = (4,3); use strict; $x = $x/$y;},

Our Result:

            Rate    dev strict 
dev    3841286/s     --    -8%  
strict 4170472/s     9%     --

Maybe a good solution is to use it to check your code and then to comment it out, maybe with a debug variable, for this take a look at Perl Debug Output.

(This is just an Example, don’t turn of use strict.)

5 thoughts on “Perl strict Benchmark”

  1. A motivating discussion is definitely worth comment.
    There’s no doubt that that you need to write more about this
    subject, it might not be a taboo subject but generally people do not speak about such issues.
    To the next! All the best!!

  2. My partner and I absolutely love your blog and find almost all
    of your post’s to be just what I’m looking for.
    Would you offer guest writers to write content to suit your needs?
    I wouldn’t mind composing a post or elaborating on a lot of the subjects you write about here.
    Again, awesome site!

  3. Excellent site you’ve got here.. It’s hard to find good quality writing like yours nowadays.
    I honestly appreciate individuals like you! Take care!!

Leave a Reply

Your email address will not be published.

10 + six =