Subj : Lazy resolution and super globals To : netscape.public.mozilla.jseng From : Damian Slee Date : Mon Sep 06 2004 06:28 pm Hi all, Trying to wrap my head around some concepts for speed and size. >>use lazy standard class resolution instead of What is the advantage of this? - Speed up initialisation. Or move it till/if it is needed. - possible less memory usage does this mean only the minimum required standard classes are created when needed? If I was to re-use a context to run a fresh script, so I don't loose the CPU time to re-create the context, how do I reset the globalObject? Delete and NewObject, or JS_ClearScope()? I read somewhere on google groups that shared superglobal is not reckomended for multithreaded (thread/context) environments. Is that still the case, even with JS_THREADSAFE & NSPR? Creating a super global? Superglobal = JS_NewObject(contextGlobal, &global_class, NULL,NULL); JS_AddNamedRoot(contextGlobal, &superglobal,"superglobal"); <-Do I need a dummy/global context here? <- global_class uses lazy resolution ..... Then once per context/thread; global = JS_NewObject(contextB, &global_class, superglobal, NULL); JS_SetGlobalObject(contextB, global); Now all contexts can access standard classes through the super global? Thanks, damian --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004 .