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

Re^3: Slow startup on raspberry pi

by hardburn (Abbot)
on Jan 16, 2015 at 21:11 UTC ( [id://1113550]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Slow startup on raspberry pi
in thread Slow startup on raspberry pi

First thing you should look at on the Rpi is having a good power supply. Cheap old cellphone chargers won't cut it. I've had good success with the Canakit adapter. Since your program is I/O limited, finding a quality SD card is the second thing you should look at. Afraid I'm not as much help for this, but I usually buy Class 10 cards and get along OK.

Looking at your list of modules, you should get rid of threads and threads::shared, preferably rewriting those pieces with fork(), or perhaps AnyEvent. A threaded perl build is noticeably slower than a non-threaded perl, and exists mainly to do pretend fork()s on Windows.

(As an aside, I just noticed that the default Raspbian perl5.14.2 is compiled with threads. I'm not sure, but hiveberry may come with a perl without threads.)

You can also ditch Switch and rewrite those parts as an if/elsif series, or perhaps given/when if you're feeling adventurous:

http://perldoc.perl.org/perlsyn.html#Switch-Statements

Just doing those, I think you'll be able to chew off a few seconds at startup time.


"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (1)
As of 2024-04-25 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found