Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Context independent, shared null && undefined #3847

Open
obastemur opened this issue Oct 2, 2017 · 5 comments
Open

perf: Context independent, shared null && undefined #3847

obastemur opened this issue Oct 2, 2017 · 5 comments

Comments

@obastemur
Copy link
Collaborator

Currently null and undefined are created per JavascriptLibrary.

  • We can't compare a JsVar to null or undefined because we don't know its' origin.
  • JsVar -> ToRecyc..Object -> Compare... is unnecessarily more complicated
  • There are some places we know JsVar is actually a Recyc..Object hence things are easier (this improvement is already merged to master). Yet, those places are very limited

Any objections to making null, undefined values are allocated per framework only once?

Is there anything else that we could use the same approach?

@MikeHolman
Copy link
Contributor

true and false are potentially useful additions.

I like the idea of sharing more static data between contexts, but I'm concerned that there may be a number of places where the ScriptContext is considered and will lead to us going down slow paths, and that you may run into a bunch of asserts.

@obastemur
Copy link
Collaborator Author

but I'm concerned that there may be a number of places where the ScriptContext is considered and will lead to us going down slow paths, and that you may run into a bunch of asserts.

@MikeHolman could you provide more context on this?

@MikeHolman
Copy link
Contributor

The example I'm thinking of is that for property caches, if an object's scriptContext isn't the current context we won't cache it. I think there are a number of places where we will do these type of comparisons.

@obastemur
Copy link
Collaborator Author

I see. How your scenario could prevent us from having a single undefined or null framework wide? (this is the part I didn't understand though)

@MikeHolman
Copy link
Contributor

MikeHolman commented Oct 3, 2017

I'm having a hard time coming up with anything that will concretely be a problem, so maybe there isn't anything. I just have a feeling that there will be a number of subtle issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants