Skip to content

Optimize sourcemap application more#25425

Merged
weswigham merged 5 commits into
microsoft:masterfrom
weswigham:more-sourcemap-emit-optimization
Jul 5, 2018
Merged

Optimize sourcemap application more#25425
weswigham merged 5 commits into
microsoft:masterfrom
weswigham:more-sourcemap-emit-optimization

Conversation

@weswigham
Copy link
Copy Markdown
Member

@weswigham weswigham commented Jul 4, 2018

With this, self-compilation time shifts much more into onEmitNode and emitBodyWithDetachedComments (as far as emit goes), and declaration diagnostics (typechecking) over the sourcemap emitter, from my observations.

Comment thread src/compiler/sourcemap.ts Outdated
const combinedPath = combinePaths(getDirectoryPath(node.sourceMapPath!), relativePath);
if (!resolvedPathCache.has(combinedPath)) {
resolvedPathCache.set(combinedPath, getRelativePathToDirectoryOrUrl(
if (!resolvedPathCache.has("" + raw.sourceIndex)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is caching the result of "" + raw.sourceIndex a worthwhile microoptimization?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VM is likely already doing that itself; but it would make the code a bit cleaner here, so I may do it for style.

@weswigham weswigham merged commit 5b92678 into microsoft:master Jul 5, 2018
@weswigham weswigham deleted the more-sourcemap-emit-optimization branch July 5, 2018 22:12
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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