Skip to content

Parsing caching #43

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

Closed

Conversation

abhinavsinghvi
Copy link

Description

I have also faced issue similar to #41.
I have found that when stack trace is coming from single huge js file it becomes very costly to generate source map stack trace as it seems currently stacktrace-gps is doing costly processing multiple time, to avoid that I have made changes to caching parsing results and re use them if required.

How Has This Been Tested?

Tested in my application and have seen almost 80% performance improvement while generating source map stack trace of error.

Checklist:

  • gulp pr passes without errors
  • npm test` passes without errors

singhvi added 2 commits October 28, 2016 21:34
--   Currently stacktrace-gps does parsing of same file multiple times
     if stack trace refers to same file. It becomes a problem when there
     is a single huge js file and complete stack trace is from that file.
     It can be optimized by caching parsing results and reuse it whereever required.
     In this commit I am making code changes to cache costly prcoessing on source map
@eriwen
Copy link
Member

eriwen commented Dec 11, 2016

@abhinavsinghvi Thanks for the PR. I'm afraid I'm not able to really use it because there are a few issues:

  • No tests were provided to verify behavior
  • Fails jscs
  • I'm not sure where the value is in having a separate cache for the source map source. Caching SourceMapURL => SourceMapConsumer should be effective enough

I have implemented the requested behavior in e173aff so I'll close this.

@eriwen eriwen closed this Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants