← Back to team overview

launchpad-dev team mailing list archive

Re: js timeout issues on ec2 due to deep js namespaces


On 09/19/2012 09:25 AM, Deryck Hodge wrote:
> On Wed, Sep 19, 2012 at 5:37 AM, Gavin Panella
> <gavin.panella@xxxxxxxxxxxxx> wrote:
>> On 18 September 2012 18:51, Richard Harding <rick.harding@xxxxxxxxxxxxx> wrote:
>> ...
>>> var ns = Y.lp.registry.product.view;
>> Why is doing this not enough? It seems that getting rid of nested
>> namespaces is a fairly big piece of work in order to avoid best
>> practice as above, i.e. simulating `from module import thing`.
> It's not just the assignment or lookup alone; there's also the
> performance hit for creating that namespace.  Also, that assignment
> hit has to be paid over and over in each test.  Every JavaScript book
> will note that nested properties are slow in every browser.  We've
> just been lazy about this.  Now we have definitive proof that it costs
> us something -- i.e. Rick had a test that failed due to a timeout
> error, due to these long namespaces.  So it makes sense to fix it now,
> or at least not make it worse going forward.

This is also another case where our lucid test runner is using a much
older version of webkit then was shipped Maverick! [1]

As Deryck says, identifier and member resolution is expensive. The
webkit we used on Maverick and beyond is about 20x faster at resolving
scopes and members than lucid.

[1] Purple stopped-the-line 6 months ago because we had genuine defects
in JavaScript that modern webkit gracefully corrected for us, but old
browsers would topple.

Curtis Hovey

Attachment: signature.asc
Description: OpenPGP digital signature