[Israel.pm] performance problems - Win32::Process which runs perl
choo at actcom.co.il
Thu Sep 14 14:26:04 PDT 2006
On Thu, 2006-09-14 at 00:08 +0300, Sagiv Barhoom wrote:
> On Wednesday 13/9/2006 03:12, guy keren wrote:
> > did you ask yourself, how quick windows can create processes in general,
> > and perl processes specifically?
> Yes I did and then i answer myself. much slower then *nix systems :-(
did you actually measure this (not on _your_ program. on a minimal
'hello world' perl program), or just guessed?
> > if this figure is already too high - you'll have to change your entire
> > approach.
> could you give me a clue ? what ather approaches there are?
changing your design. don't generate a script per record in the database
table. since i don't know what your code does, how can i suggest
> > by the wa, just a silly question - are you running the processes
> > sequentially (i.e. the 2nd process is created only after the first
> > process terminated), or in parallel? if the later - you're thrashing
> > your machine's resources.
> parallel . "you're thrashing your machine's resources." could you please
if you are trying to execute 1000 programs you can:
1. execute them 1 by 1.
2. execute them all at once.
3. anything in between.
executing them all at once will mean that they will all compete for CPU,
memory etc. this means they'll starve each other, and the machine spend
most of its time on managing those 1000 processes, rather then on
actually executing the code written in them. it will do many many
context switches, fill the RAM and thus start swapping and paging, etc.
in general, when running CPU-bound programs on a machine with N CPUs,
executing more then N programs at once is stupid.
further, if you have a given amount of RAM X, executing processes in a
number that'll require more then X at once, is stupid too.
(when i say stupid, i didn't say you are stupid. i say this action is
stupid. stupid things might be done by smart people).
> Regards Sagiv
> Perl mailing list
> Perl at perl.org.il
More information about the Perl