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

Maybe perl is simply not appropriate on low performance platforms except for one-liners and I have to rewrite the stuff in C.

But I thought earlier you said "Once running, the performance is good"? It sounds like you're just running this script once on boot, like a daemon, or does it get started & stopped more often? If just once on boot, I'm not sure what the problem is, why do you really need to optimize the boot time? I understand the speed might be a bit annoying during development but hey, that's the price for running on that hardware ;-) Maybe you can develop on a desktop machine?

The Rasperry Pi is in general "slow" by modern standards so if you want to use it you'll have to live with a bit of relative slowness no matter what you do with it - try running startx on it to get a feeling for the speed! FWIW, I've written a bit of Perl for the Pi myself, admittedly with less modules than you're using, and those scripts ran just fine.

Replies are listed 'Best First'.
Re^4: Slow startup on raspberry pi
by vivat (Initiate) on Jan 16, 2015 at 13:23 UTC
    The overall boot time is crucial for that application. I optimised the raspberry pi boot time to 20s but get additional more than 10s by this perl script. I.e. the whole linux system needs 20s but a simple perl script adds 10s.
      It's not a simple Perl script your modules are using other modules which in turn use other modules ...

      And at least one of them is either doing heavy initialization or IO accessing.

      Reprogramming it in C won't help much.

      But learning how to use the NYT profiler and identifying the bottleneck is far more efficient.

      Cheers Rolf

      PS: Je suis Charlie!

      The overall boot time is crucial for that application.

      Ok, thanks for the clarification. I'm still not really surprised that you're getting that kind of performance out of the Pi in general... how fast is your SD card? Perhaps throwing a little more hardware at the problem would help? For example I've read good things about the quad-core 1.5 GHz ODROID-C1, for $35 (http://www.hardkernel.com/).