On Apr 29, 4:43 pm, Bemi Faison <[email protected]> wrote:
> @Gildas
>
> I think that's incredibly useful information. Thanks for the link!
>
> What about "building" an object? I don't know whether to call it
> object-composition or the object-factory pattern, but don't libraries
> use this to provide advanced object-inheritance features? I've always
> felt this would be incredibly slow - compared to using the prototyype
> chain or assigning privileged methods within a constructor.
>
> How fast is it to return created objects? (I'm not even sure if this
> is how the object-factory pattern works exactly - that is, without the
> "new" operator.) Could you add something like this to your tests?
>

It's the worst way of creating and using (i.e. method call) objects in
term of speed in my test. It's not really surprising ;)

Scott is right, you can make a new version of any test available on
jsperfs.com: just just have to add "/edit" on the URL. You can also
make yours.
Anyway, I added your code suggestion in revision 6. The test is
slightly different since my colleague remarked to me it world be
interesting to split object creation and method call to simplify
results readability.

See here: http://jsperf.com/prototype-members-vs-instance-members/6

-- 
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]

Reply via email to