Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Newbie question

by Anonymous Monk
on Aug 23, 2022 at 12:46 UTC ( [id://11146315]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Newbie question
in thread Newbie question

Talk of optimization is premature?

Replies are listed 'Best First'.
Re^4: Newbie question
by Marshall (Canon) on Aug 23, 2022 at 15:48 UTC
    What I was trying to say is that the easiest to "code and understand" way is also likely to be the fastest way. And I was encouraging that. It really doesn't matter how good/bad the detailed implementation of abs() is, the time to execute the worst imaginable implementation is likely faster than making decisions about default behavior in light of an exception (the '-') and also suppressing normal exception behavior. I also suspect that either choice is completely dwarfed by the by the split operation and creation of the list of individual numbers.

    I don't think any benchmarking or further optimization is warranted here. I vote for the easy to understand way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found