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.
Product Version: NetBeans IDE 7.4 (Build 201310111528) Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1 Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\7.4 Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\7.4 Both the Javascript and Java code formatters are too slow. The Javascript formatter is extremely slow, about 10x slower than the Java formatter. I expect to be able to code-format 1000 lines of code in one second. Ambitious, I know. I believe currently Java takes about 3-5 seconds and Javascript over 30 seconds. I am filing this issue at a high level (not specific to Java or Javascript) because I suspect that we can make some high-level changes that will improve performance for all languages. Could someone please profile the code and report the hotspots? 1. Can the operation be distributed across multiple cores? 2. Would it help to build the AST as the user is typing instead of doing so when code-format is invoked? (CPU power is growing at a much slower rate than memory)
I have a JS file with ~4500 lines and it takes ~2 secs to format it so it could be something with the particular file. Could you please create profiling snapshot [1] during the formatting and attach it here? Or perhaps the JS file, if possible? If you want to improve formatting time in Java file (or others), please report it individually as single issues. Thank you. [1] http://wiki.netbeans.org/FaqProfileMeNow
Created attachment 142726 [details] .npss file attached from NetBeans .npss file
I've attached a profiler snapshot for your review. Let me know what you find and if you really need it I will send you the relevant JS file privately (it is confidential and cannot be attached to this bug report).
I forgot to mention: the file used to generate the profiler snapshot consists of 719 lines and took 15 seconds to code-format using ALT+SHIFT+F.
Well it looks like project loading cause delay on getting initial indentation and other formatting preferences.
I can't see anything related to Java EE part's of Maven, reassigning to Milos
http://hg.netbeans.org/core-main/rev/f5d837a0fa59 while we cached the values themselves, we didn't cache the call the decided if checkstyle formatting is enabled or not, now we do. please test with your setup