Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Use precise=false for performance when parsing unchanging code #5395

Merged
merged 3 commits into from
Oct 3, 2013

Conversation

redmunds
Copy link
Contributor

@redmunds redmunds commented Oct 2, 2013

This is for #4608 (please ignore branch name). See bug for details.

@njx @RaymondLim have been following this one.

Are there any other places where we can isolate calls to getTokenAt() and set precise=false?

@RaymondLim
Copy link
Contributor

@redmunds Nice job in finding the culprit and the solution. I think we may also improve the performance in js files as we have a couple of getTokenAt() calls with precise=true in extensions/default/JavaScriptCodeHints/Session.js.

@redmunds
Copy link
Contributor Author

redmunds commented Oct 2, 2013

@iwehrman This should also fix the performance problem you were seeing with parsing <style> blocks.

@redmunds
Copy link
Contributor Author

redmunds commented Oct 2, 2013

@RaymondLim Good catch! I also made fix in extensions/default/JavaScriptCodeHints/Session.js .

@ghost ghost assigned RaymondLim Oct 2, 2013
@RaymondLim
Copy link
Contributor

@redmunds Can you rebase your changes to the latest master or create a new branch with the latest master and reapply your changes? The code changes look good, but when I run your branch, I didn't see text as I type. It took a while to show up a block of text and then to show JS hints. So it's not clear your changes fix the issue or not.

@redmunds
Copy link
Contributor Author

redmunds commented Oct 2, 2013

@RaymondLim There are only 2 commits that change different files, so there's nothing to rebase. I merged the latest code from master, but it was only 13 commits.

The main change should make the initial loading of JS faster, so first hint will display faster. After that it should have no effect. To test this, open 2 files (1 HTML with <script> block, and 1 JS file) and switch back and forth (hints get reloaded whenever you switch to different file). You may also see this improvement with Quick Open of both JS and CSS.

The second change I made for JS Code Hints is general parsing around cursor location. If you can't see a difference, then maybe it should be backed out to reduce risk.

@RaymondLim
Copy link
Contributor

Looks good. Merging.

RaymondLim added a commit that referenced this pull request Oct 3, 2013
Use precise=false for performance when parsing unchanging code
@RaymondLim RaymondLim merged commit b577c41 into master Oct 3, 2013
@RaymondLim RaymondLim deleted the randy/issue-5003 branch October 3, 2013 22:09
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