First of all, I would strongly advise against object pooling in a language with GC. Most of the time it creates far more problems than it solves, and one of the few valid use cases is when object creation is extremely costly, like e.g. for data base connections, but it seems that this is not the case for you. When GC takes a large percentage of the whole runtime, the problem is often that objects are retained too long, i.e. a performance bug in user code. Modern GCs should handle rapid allocations of short-lived objects quite well.
Regarding your followup question: In general v8 has the best performance when you pretend that JavaScript has strong typing, so you e.g. only assign numbers to properties which you intend to use in arithmetic, only strings to properties used in string operations, etc. But assigning dummy values in the constructor looks like a design flaw to me. Either the object is in consistent state without those properties (then there is no need to assign anything), or the object's state really needs some values for these properties (then the dummy values are conceptually wrong). Why do you want to do these dummy assignments? Cheers, S. -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
