Subj : Re: JavaScript performance in the real world To : netscape.public.mozilla.jseng From : Shanti Rao Date : Fri Sep 17 2004 08:21 pm Brendan Eich wrote: > Shanti Rao wrote: > >> What I did to solve this problem was write a jsGC() function that >> calls JS_GC(). Call it at the end of your loop. > > > > This could easily make the runtime go through the roof, because it > forces a GC for every loop iteration -- or did you mean "after the end > of your loop"? > > GC should be automated. If script has to call it, the embedding and the > engine have failed in their duty to schedule GC well. And I will bet > real money that script will call the GC too often, screwing performance. How about "every once in a while"? Since SM doesn't know that it's running out of system resources, memory needs to be recovered somehow. I guess that frequent GCs aren't the best way. I'm all for having the "delete" operator act immediately, since this problem tends to happen when a single object (like a SQL result set) owns a lot of system resources. It doesn't have to be called "delete" either. In this case, I think the best solution is a way of telling the ODBC driver to release the statement handles it no longer needs. Jens, is this discussion useful? Shanti .