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

Optimize performance of maps (with ES3 support) #10298

Closed
wants to merge 2 commits into from
Closed

Optimize performance of maps (with ES3 support) #10298

wants to merge 2 commits into from

Conversation

rbuckton
Copy link
Member

This PR implements the same optimizations as #10270 when in an ES5 or better host environment, while still maintaining support for ES3. This is a port of my changes for the transforms branch that lead to #10270 and can be considered an alternate approach.

The key differences between this and #10270 are:

  • hasProperty/getProperty replaced with Map.has/Map.get and MapLike.has/MapLike.get
  • Introduced a Map.guard function for use with for..in enumeration which guards on hasOwnProperty in ES3
  • Consolidates common Map related functionality in helper functions on the Map and MapLike interfaces.
  • Map.create creates an object with a null prototype in ES5+, and a regular object literal in ES3.

Even with the for..in guard, I'm seeing the same performance numbers as in #10270:

  • Monaco compile time is approximately 15% faster.
  • Angular compile time is approximately 14% faster.
  • TFS compile time is approximately 18-20% faster.

@rbuckton
Copy link
Member Author

Closing in favor of #10270.

@rbuckton rbuckton closed this Aug 12, 2016
@mhegazy mhegazy deleted the maps branch November 2, 2017 21:03
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants