"be consistent" | |
PerlMonks |
Re^3: Slow startup on raspberry piby hardburn (Abbot) |
on Jan 16, 2015 at 21:11 UTC ( [id://1113550]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|