Thanks Kannan, I'll start from reproducing and tracing GetProp. Ting
----- 原始郵件 ----- > 寄件者: "Kannan Vijayan" <[email protected]> > 收件者: [email protected] > 寄件備份: 2014 7 月 31 星期四 下午 10:59:21 > 主旨: Re: [JS-internals] 'in' operator is slow? > > > Ok here's the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1046792 > > Treat this as a meta-bug, and make sub-bugs for each specific type of > optimization you're working on. > > Thanks again for attempting this. If you have any questions, please > feel free to needinfo? me on the bug, or ping me on irc.mozilla.org > #jsapi (my nick is djvj). If I'm not around or not responding, you can > also potentially ask jandem, nbp, or h4writer about stuff. > > Cheers! > Kannan > > On 2014-07-31, 10:35 AM, Kannan Vijayan wrote: > > Hi Ting, > > > > Of course, that's fantastic :) I can mentor the bug for you if you'd > > like. I'll just create the bug right now. > > > > Kannan > > > > On 2014-07-31, 12:04 AM, Ting-Yu Chou wrote: > >> Sorry to bump in, but I am interested if those are good beginner > >> bugs, would > >> that be OK? > >> > >> Thanks, > >> Ting > >> > >> ----- Original Message ----- > >>> From: "Kannan Vijayan" <[email protected]> > >>> To: [email protected] > >>> Sent: Wednesday, July 30, 2014 9:44:12 PM > >>> Subject: Re: [JS-internals] 'in' operator is slow? > >>> > >>> The simple reason is that we don't optimize this case in Ion yet. > >>> > >>> Looking at IonBuilder's handling of JSOP_IN, it optimizes the case > >>> where > >>> the property being checked for is a dense element and the object is > >>> well-known, but it doesn't optimize property checks. > >>> > >>> The "full treatment" of this op would include the following: > >>> > >>> 1. Optimize property checks using Type-Inference. This will only work > >>> for definite properties. > >>> 2. Optimize property checks using Baseline IC stubs, inlining shape > >>> guards into the main jitcode body. > >>> 3. Optimize property checks using Ion ICs. > >>> > >>> These are, in fact, really good beginner bugs. Most of the logic here > >>> will be equivalent to the GetProp implementations, except instead of > >>> returning the value from the property slot, it will return true/false.. > >>> so there's a good existing reference for how to implement this. > >>> > >>> Kannan > >>> > >>> > >>> On 2014-07-30, 9:25 AM, Nicholas Nethercote wrote: > >>>> Hi, > >>>> > >>>> The following jsperf microbenchmark suggests that |p in o| is much > >>>> slower than |o.p !== undefined|: http://jsperf.com/in-vs-not-undefined > >>>> > >>>> Can someone explain why? > >>>> http://stackoverflow.com/questions/13866442/why-is-javascripts-in-operator-consistently-slower-than-strict-member-compari > >>>> > >>>> discusses this, but I'm not entirely convinced. Maybe the ToString() > >>>> required for 'in' explains it? > >>>> > >>>> Thanks. > >>>> > >>>> Nick > >>>> _______________________________________________ > >>>> dev-tech-js-engine-internals mailing list > >>>> [email protected] > >>>> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > >>> _______________________________________________ > >>> dev-tech-js-engine-internals mailing list > >>> [email protected] > >>> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > >>> > >> _______________________________________________ > >> dev-tech-js-engine-internals mailing list > >> [email protected] > >> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > > > > _______________________________________________ > > dev-tech-js-engine-internals mailing list > > [email protected] > > https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > > _______________________________________________ > dev-tech-js-engine-internals mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > _______________________________________________ dev-tech-js-engine-internals mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

