roxen.lists.pike.general

Subject Author Date
Re: Startup times Pike vs. Perl Stephen R. van den Berg <srb[at]cuci[dot]nl> 17-08-2009
Martin B?hr wrote:
>On Mon, Aug 17, 2009 at 10:08:54AM +0200, Stephen R. van den Berg wrote:
>i am surprised that you only notice this now.
>pike has always had a slow start up

Yes, but previously, I wasn't using it in a setting where I start up Pike
a lot for small scripts.  Additionally, when running it by hand on a
sufficiently powerful machine these days, the delay is close to
unnoticable by hand.  So...  I didn't notice/care (enough) until recently ;-).

However, I recently creating custom firewalls from the pcengines alix
systems that use an AMD Geode LX800 with 256MB RAM.  And in order to create
a decent webinterface on those things I contemplated installing Roxen, but
that was/is a bit too heavy I'm afraid.  So the alternative is to use
lighttpd in combination with either /bin/sh, Perl or Pike as cgi-scripts.
The /bin/sh I did, but it's a bit cumbersome at times.  The Perl is what
everybody else does, but I avoided using Perl for 20 years now, and wasn't
about to change policy.  So I compiled a "minimal" Pike distro out of 7.8
which results in a disk requirement of about 13MB which is ok.  The sad thing
though is that the startup time is 0.66 seconds on this system.  It's not
unworkable, but it isn't pretty either.

>i still do not understand why this is the case.
>maybe your research can shed some light on this...

My brief and preliminary analysis seems to indicate that there is a lot of
low-hanging fruit.  Not quite sure how much of a difference it is going to
make, but improving the hashing for static strings might reduce the memory
footprint (a bit) *and* improve startup times (a bit) at the same time.
Heck, the static strings could possibly even be hashed at compile/install time
(in the installer pass?).
-- 
Sincerely,
           Stephen R. van den Berg.

"God... root...  what's the difference?..."