Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Warnings and Strict in Production/Performance

by ikegami (Patriarch)
on Oct 17, 2006 at 17:09 UTC ( #578843=note: print w/replies, xml ) Need Help??

in reply to Warnings and Strict in Production/Performance

Warnings are strong indicators of errors. Do you know the cause of the warnings you have received? If the warnings you received reveal code that needs to be fixed, then you can show their worth.

Are your coworkers planning on altering core and 3rd party modules as well? Wouldn't it be simpler to make warnings die noisily? Something as simple as $SIG{__WARN__} = sub { die ... }; might satisfy them.

The performance hit of warnings is negligible, IIRC. Feel free to Benchmark them.

Update: The following demonstrates that 100,000 warnings checks did not slow down Perl at all.

use strict; use warnings; use Benchmark qw( cmpthese ); my $passes = 100_000; my $tests = -10; sub with { use warnings; my $i = 0; $i = $i + 1 # Undefined check for 0..$passes; 1; } sub without { no warnings; my $i = 0; $i = $i + 1 # No undefined check for 0..$passes; 1; } cmpthese($tests, { with => \&with, without => \&without, });


Benchmark: running with, without, each for at least 10 CPU seconds... with: 10 wallclock secs (10.24 usr + 0.00 sys = 10.24 CPU) @ 20 +.40/s (n=209) without: 11 wallclock secs (10.40 usr + 0.01 sys = 10.41 CPU) @ 20 +.47/s (n=213) Rate with without with 20.4/s -- -0% without 20.5/s 0% --

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2022-01-16 18:28 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (49 votes). Check out past polls.