| Summary: | Multiple js file parsing on every js file modification | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Natalia Bartol <natalia.bartol> | ||||||
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> | ||||||
| Status: | RESOLVED WONTFIX | QA Contact: | Chris Jaun <cmjaun> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | jacek.pospychala, natalia.bartol, zhaozhongwei | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Natalia Bartol
Created attachment 207837 [details]
Example JavaScript project
To see described issue add .options file to your eclipse with content:
org.eclipse.wst.jsdt.core/debug=true
org.eclipse.wst.jsdt.core/debug/builder=true
org.eclipse.wst.jsdt.core/debug/compiler=true
BTW default .options file could be attached to org.eclipse.wst.jsdt.core plugin.
Start your eclipse with -debug -console parameters.
Import attached JavaScript project.
Open myscript.js.
Type one character.
You should see output as in previous comment.
Created attachment 207838 [details] this patch will improve this bug this patch is for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=362024 I did nothing,just uncomment several lines,I think there must be some reason to comment these lines,can anyone tell me? Thanks Debug output after applying Zhao's patch: [parsing C:/to-remove-test-workspace-3011/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/xhr.js - #1/1] [parsing C:/to-remove-test-workspace-3011/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/browserWindow.js - #1/1] [parsing C:/to-remove-test-workspace-3011/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/system.js - #1/1] [parsing C:/to-remove-test-workspace-3011/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js - #1/1] Seems to be better. Each files is parsed only once. Is it necessary to parse ALL js files in a project in case of a single file modification? Is there a way to exclude external libraries? I'm guessing that was the only file in the project. The parsing is done at the behest of the as-you-type validation, which essentially compiles the file, creating type bindings. Bindings remain in memory during the entire operation, and automatically building them for every type in every file encountered when we were looking for just one type causes memory to spike and cause OOMEs readily when working with larger projects (bug 345797). The trade-off made was to only build them for the type we were actually looking for, and while this increases the I/O if we need to parse a file again, it scales better memory-wise. You're seeing these files parsed regardless because your project designates Window as the common supertype--so we have to build that, as well as the types for its member properties. There may be ways to reduce that redundancy as well, but for now those lines being commented out is entirely intentional. For the reasons Nitin mentioned, this is working as designed. |