Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Recents changes

30 views
Skip to first unread message

a.c...@weelya.com

unread,
Apr 13, 2013, 2:09:17 PM4/13/13
to dev-tech-...@lists.mozilla.org
Hey all,

I'm using m-c for my application and in the process of perf
optimization.

I was wondering few things :

* I understand the purpose of JSPROP_NATIVE_ACCESSORS. That's is, using
a JSNative definition instead of regular setter/getter definitions.
What's the advantage? Is there some perf impact? How to access the
"jsid" using this?

* What sort of optimization can be done with JSJitInfo? (and how to use
it)

* Are there some other new things that can have big impact of perf we
should be aware of? (specially when using a bunch of native
getter/setter)

Thanks!

Anthony Catel

Nicolas B. Pierron

unread,
Apr 13, 2013, 7:43:19 PM4/13/13
to
On 04/13/2013 11:09 AM, a.c...@weelya.com wrote:
> * I understand the purpose of JSPROP_NATIVE_ACCESSORS. That's is, using a
> JSNative definition instead of regular setter/getter definitions. What's the
> advantage? Is there some perf impact? How to access the "jsid" using this?

Yes, there is a negative perf impact because we have to do a call to a
native, and such calls are slower than calls to compiled-JS functions.

Then if the accessors are doing a lot of work, it might still be better to
have native in terms of performances.

> * What sort of optimization can be done with JSJitInfo? (and how to use it)

The JSNative are used by the interpreter and the baseline (I guess), but the
JSJitInfo is used to give information such as isPure, which are used in
IonMonkey optimizations such as LICM & GVN.

This interface has been made to improve DOM bindings and some optimizations
related to it are clearly tied to the way the DOM is working, which is
setting the private field of the JSObject to hold the pointer to the real
data, while still having some class hierarchy in JSClass (from what I
understood).

The fields protoID, depth are used to check that we have the right DOM
JSClass, and thus be able to factor some common type-checking logic (within
Ion code) which is otherwise always executed when running the JSNative. As
we can factor these parts out-side the DOM the JSJitPropertyOp is used to
hold the pointer to a function which does not have this checking logic and
assume that the type is correct.

> * Are there some other new things that can have big impact of perf we should
> be aware of? (specially when using a bunch of native getter/setter)

Not that I know of.

--
Nicolas B. Pierron
0 new messages