This thread gave me the idea to compare performances of 2 ways of creating objects : - by adding methods to prototype object - by adding methods directly to the new object (but function definitions are not copied and parsed for each new object)
The majority of modern browsers give better results when adding members to prototype object but it also depends on method calls number. BTW, I think V8 guys have found a great optimization in chrome 13... Here is the test : http://jsperf.com/prototype-members-vs-instance-members/2 -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
