Perl can be small, and relatively fast, apache cgi invocations of perl
scripts (mod-cgi not mod-perl) load the  perl "engine"(whatever it might be
called, interpreter/VM/JITcompiler) for every process, as far as I know
anyway, hence the rise of mod-perl which caches the compiled perl scripts
and the "engine" in RAM between requests for a faster startup, or so I
understand.

Don't know how to deal with pipeing to a daemon though, without invoking a
messaging process and defeating the purpose of the daemon. If you know that
one, then perl does http & regex quite well (assuming you need to build your
requests out of the input), but java does threads and OO nicely.


> -----Original Message-----
> From: Jeff Kilbride [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 05, 2001 8:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: JAVA vs. PERL startup time + memory
>
>
> Wouldn't it be easier to create a daemon of some sort that stays
> loaded and
> accepts requests, rather than creating a new process each time?
> Whether you
> use Java or Perl, this will make a much bigger performance difference than
> the language itself. If you must write something that creates a
> new process,
> my only recommendation would be to do it in a non-interpreted
> language (i.e.
> C, C++, etc...) to avoid the overhead of the interpreter.
>
> The nice thing about Java is that it's relatively simple to create a
> multi-threaded daemon.
>
> --jeff
>
> ----- Original Message -----
> From: "tim leung" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, May 05, 2001 11:39 AM
> Subject: JAVA vs. PERL startup time + memory
>
>
> > Hi,
> > I am thinking of write an unix app that will get data
> > from a pipe  e.g.  |       and then will do a HTTP
> > POST to some server.
> >
> > e.g.  command1 xxxx  |  java PipeReader    -- OR --
> > e.g.  command1 xxxx |  perl PipeReader
> >
> > Assume I need to invoke the JVM process or PERL
> > process very frequently ( 5 times / sec ) --> ( 300
> > times / min )
> >
> > I know that Java's startup time is slow. and it
> > allocation a block of per-defined memory when it
> > starts up.  like 2MB. although it may only
> > use 300KB.  so. I think start a JVM process is SLOW
> > and need lots of
> > memory.
> >
> > I am not very familiar with PERL. I wonder if I invoke
> > 300 PERL process / min, is it faster and use less
> > memory than invoke 300 JVM process / min?
> >
> > Both will do the same thing.--> each time it's'
> > invoked, it will do a HTTP POST of some data get from
> > the pipe ( stdin ) and then System.exit().
> >
> > thanks.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great prices
> > http://auctions.yahoo.com/
> >
>

Reply via email to