-
Notifications
You must be signed in to change notification settings - Fork 0
[CLOSED] Improve TokenUtils performance through caching #8854
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
Comments
|
I think the (1 sec) timeout should be replaced by listening for the Document "change" event. If there's a change to the line that's cached, then clear it. Also, there can be multiple contexts at one time, so it might be worth having a cache for each context object. This is usually used to looking ahead to next (or back at previous) token when parsing without affecting current context, so it will usually use the same cached line, but this is something to keep in mind as a future improvement. |
The |
Done with code review. |
Ugh, didn't notice there's a JSHint error. Ah, and the problem with |
Search both language/CSSUtils.js and language/HTMLUtils.js and for
As I said, this just needs to be kept in mind -- we might not need this. Seems like the worst performance is in minified files where everything is in (mostly) 1 line, so a single cache should work. |
Just switched About doc.change events: |
That's only true for
The problem with UPDATE: it looks like you can pass a function to |
It's actually not a Brackets Editor object, but these are actually only CodeMirror instances - so I can't use |
You can listen to the CodeMirror instance "changes" event: cm.on("changes", function (instance, changeList) {
}); |
I have implemented the (still somewhat experimental) CM changes handler. |
|
|
Travis CI is failing. It does not appear to be related to this code, but I want to make sure this passes before merging. |
Merging. |
Tuesday Nov 18, 2014 at 22:22 GMT
Originally opened as adobe/brackets#9964
For #9717.
Testing
Test 1
Using this file: https://gist.github.com/MarcelGerber/5c11f1031af292044708, place your cursor in the
<script>
tag and pressCtrl-Space
.Test 2
Using same file, place your cursor in the
<body>
tag and pressCmd/Ctrl-E
.MarcelGerber included the following code: https://github.com/adobe/brackets/pull/9964/commits
The text was updated successfully, but these errors were encountered: