This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Resolving types in model is very slow | ||
---|---|---|---|
Product: | javascript | Reporter: | Petr Pisl <ppisl> |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | mmirilovic, phejl, pjiricka, vriha |
Priority: | P1 | Keywords: | PERFORMANCE |
Version: | 7.3 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Petr Pisl
2013-02-04 14:02:08 UTC
The root of the problem is in the recursion that is used in ModelUtils.getDeclarationScope(Declaration scope, int offset). When the recursion I have replaced with new cycle the result time is about 3 second smaller. Parsing in Nashorn - 1200ms, creating object from AST - 630 ms and resolving types 1 400ms. This means that new algorithm is faster about 61%. The fix was pushed into the web-main:http://hg.netbeans.org/web-main/rev/a49d3a59079f I would like to ask Petr Hejl to review it. Thanks LOGGER.log(Level.FINE, "Building model took {0}ms. Resolving types took {1}ms", new Object[]{(end - start), (end - startResolve)}); Creates array even when logging is disabled. Check logging level in advance. Get rid of System.out. Otherwise looks good. Thanks for the review. I have did the changes as Petr wrote. Also I increased the version of the index. http://hg.netbeans.org/web-main/rev/9708751ae76e seems OK for me http://hg.netbeans.org/releases/rev/5e5b37d59b02 http://hg.netbeans.org/releases/rev/9d7e2fb1fb2b Both fixes transplanted to the releases repository. Integrated into 'releases', will be available in build *201302050851* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/5e5b37d59b02 User: Petr Pisl <ppisl@netbeans.org> Log: #225707 - Resolving types in model is very slow (transplanted from a49d3a59079ff2ee0237cc611f59d2013abc348d) Integrated into 'main-golden', will be available in build *201302050917* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/a49d3a59079f User: Petr Pisl <ppisl@netbeans.org> Log: #225707 - Resolving types in model is very slow no regression found, verified Product Version: NetBeans IDE 7.3 (Build 201302132200) Java: 1.7.0_15; Java HotSpot(TM) Client VM 23.7-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b02 System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb) |