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

fix: Speed up source map generation by only stringiying at the end #624

Merged
merged 1 commit into from
Aug 9, 2019

Conversation

FuegoFro
Copy link
Contributor

@FuegoFro FuegoFro commented Aug 8, 2019

Currently when generating source maps, we stringiyf the in-progress
indexMap once for every. single. file. even though we only care about
the final result (and indeed overwrite our previous stringification each
file). This was likely a typo and intended to be outside the forEach, so
this change moves the stringification to after we're fully done building
up the indexMap. This dramatically speeds up source map generation since
we're doing significantly less work with fewer allocations and GCs.

Currently when generating source maps, we stringiyf the in-progress
indexMap once for every. single. file. even though we only care about
the final result (and indeed overwrite our previous stringification each
file). This was likely a typo and intended to be outside the forEach, so
this change moves the stringification to after we're fully done building
up the indexMap. This dramatically speeds up source map generation since
we're doing significantly less work with fewer allocations and GCs.
@zamotany zamotany merged commit 4b003f4 into callstack:master Aug 9, 2019
@zamotany
Copy link
Contributor

zamotany commented Aug 9, 2019

@FuegoFro Thank you this PR 👍

@FuegoFro
Copy link
Contributor Author

FuegoFro commented Aug 9, 2019

Thank you for the review+merge! 😀

@FuegoFro FuegoFro deleted the source_map_generation_speed_up branch August 9, 2019 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants