THREADS Management XUL/FIREFOX

Takis Psarogiannakopoulos <[email protected]> Tue, 17 Feb 2009 17:37:06 -0800 (PST)
Newsgroups gmane.comp.mozilla.performance
Message-ID <[email protected]>

Hello,

I am looking to improve the performance of Firefox 2/3, XUL etc
In the mozilla code I see the following:

mozilla/netwerk/dns/src/nsHostResolver.cpp:#define MAX_THREADS 8
mozilla/netwerk/base/src/nsIOThreadPool.cpp:#define MAX_THREADS 4
mozilla/security/nss/cmd/vfyserv/vfyserv.h:#define MAX_THREADS 32
mozilla/security/nss/cmd/strsclnt/strsclnt.c:#define MAX_THREADS 128
mozilla/security/nss/cmd/selfserv/selfserv.c:#define MAX_THREADS 4096


Now 8 threads in a process is already a fair amount of overhead if you
assume they are allowed to run with a descent stack. I would say optimum
4-6 I  its good for most systems. Eg I know from a fact that
over 9 threads on a recent Xlib (R70) and you are bound to run on
syncronization issues one way or another.
I was wondering: is there is a max number of threads that, say, the
firefox process can create? In other words is there is a global limit for
the number of LWP? Obviously that 4096 is ... 32 also way too much.
Moreover the DNS resolver is allowed just by it self to create 8 different
threads?  Isnt that too much? (please note the dns resolver threads
there are lwps that need a a fair amount of stack too for the job are
intented to do!)

Kind Regards,