Community
Participate
Working Groups
I20031126 The refactoring infrastructure currently uses documents to manipulated the content of a text document. This can cause problems when modifying the source of large CUs. See bug 47689.
We should check what we can do to inform the user about the slowness of such an operation.
Besides the memory consumption we have to do a trace to figure out if something else is slow.
The problem seems to be the AST creation. Although the file isn't "really" big, typically stack traces I took look like the following. I took them from time to time for over a minute. Moving to JDT/Core. Thread [main] (Suspended) ASTConverter.removeExtraBlanks(Expression) line: 2977 ASTConverter.convertToParenthesizedExpression(Expression) line: 839 ASTConverter.convert(Expression) line: 730 ASTConverter.convert(BinaryExpression) line: 1495 ASTConverter.convert(Expression) line: 809 ASTConverter.convertToParenthesizedExpression(Expression) line: 844 ASTConverter.convert(Expression) line: 730 ASTConverter.convert(BinaryExpression) line: 1495 ASTConverter.convert(Expression) line: 809 ASTConverter.convert(ArrayReference) line: 417 ASTConverter.convert(Reference) line: 472 ASTConverter.convert(Expression) line: 824 ASTConverter.convert(Assignment) line: 1095 ASTConverter.convert(Expression) line: 758 ASTConverter.convert(Statement) line: 1752 ASTConverter.convert(SwitchStatement) line: 1969 ASTConverter.convert(Statement) line: 1724 ASTConverter.convert(Block) line: 1788 ASTConverter.convert(Statement) line: 1691 ASTConverter.convert(ForStatement) line: 1917 ASTConverter.convert(Statement) line: 1712 ASTConverter.convert(AbstractMethodDeclaration) line: 673 ASTConverter.buildBodyDeclarations(TypeDeclaration, TypeDeclaration) line: 243 ASTConverter.convert(TypeDeclaration) line: 182 ASTConverter.convert(CompilationUnitDeclaration, char[]) line: 80 AST.parseCompilationUnit(char[]) line: 833 AST.parseCompilationUnit(ICompilationUnit, boolean, WorkingCopyOwner) line: 373 AST.parseCompilationUnit(ICompilationUnit, boolean) line: 247 RenameTypeProcessor.analyseEnclosedTypes() line: 497 RenameTypeProcessor.checkInput(IProgressMonitor) line: 314 RenameCompilationUnitProcessor.checkInput(IProgressMonitor) line: 272 RenameRefactoring.checkInput(IProgressMonitor) line: 160 CheckConditionsOperation.run(IProgressMonitor) line: 65 CreateChangeOperation.run(IProgressMonitor) line: 100 PerformChangeOperation.run(IProgressMonitor) line: 138 ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 302 ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 252 RefactoringWizardDialog2.run(boolean, boolean, IRunnableWithProgress) line: 271 PerformRefactoringUtil.performRefactoring(PerformChangeOperation, Refactoring, IRunnableContext, Shell) line: 53 RenameCuWizard(RefactoringWizard).performFinish (PerformChangeOperation) line: 409 RenameRefactoringWizard$1(UserInputWizardPage).performFinish() line: 119 RenameCuWizard(RefactoringWizard).performFinish() line: 472 RefactoringWizardDialog2.okPressed() line: 395 RefactoringWizardDialog2(Dialog).buttonPressed(int) line: 263 Dialog$1.widgetSelected(SelectionEvent) line: 430 TypedListener.handleEvent(Event) line: 89 EventTable.sendEvent(Event) line: 82 Button(Widget).sendEvent(Event) line: 847 Display.runDeferredEvents() line: 2311 Display.readAndDispatch() line: 1992 RefactoringWizardDialog2(Window).runEventLoop(Shell) line: 586 RefactoringWizardDialog2(Window).open() line: 566 RefactoringStarter.activate(Refactoring, RefactoringWizard, Shell, String, boolean) line: 56 RenameUserInterfaceStarter(UserInterfaceStarter).activate(Refactoring, Shell, boolean) line: 112 RenameUserInterfaceStarter.activate(Refactoring, Shell, boolean) line: 111 UserInterfaceStarter.run(Refactoring, Shell, boolean) line: 68 UserInterfaceStarter.run(Refactoring, Shell) line: 46 RenameRefactoringAction.run(RenameRefactoring, Shell) line: 73 RenameSupport.openDialog(Shell) line: 93 RenameJavaElementAction.run(IJavaElement, RenameSupport) line: 156 RenameJavaElementAction.run(IStructuredSelection) line: 78 RenameAction.run(IStructuredSelection) line: 116 RenameAction(SelectionDispatchAction).dispatchRun(ISelection) line: 212 RenameAction(SelectionDispatchAction).run() line: 188 RenameAction(Action).runWithEvent(Event) line: 842 ActionContributionItem.handleWidgetSelection(Event, boolean) line: 509 ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 461 ActionContributionItem$5.handleEvent(Event) line: 408 EventTable.sendEvent(Event) line: 82 MenuItem(Widget).sendEvent(Event) line: 847 Display.runDeferredEvents() line: 2311 Display.readAndDispatch() line: 1992 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1506 Workbench.runUI() line: 1482 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 246 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 139 IDEApplication.run(Object) line: 47 PlatformActivator$1.run() line: 226 EclipseStarter.run(String[], Runnable) line: 85 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 79 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 41 Method.invoke(Object, Object[]) line: 386 Main.basicRun(String[]) line: 279 Main.run(String[]) line: 742 Main.main(String[]) line: 581
Dirk - pls assess if this is still an issue in latest. If not, or too many changes occurred in this area, simply close it.
Hard to judge. I check the code and we are still creating an AST in this method. Since I don't know which test case we used for this I can't test if it still exists. I opt for the following: if normal performance traces show that the method ASTConverter.removeExtraBlanks(Expression) behave normal speed wise, I support closing this bug. Markus, can you please look at our performance tests in this area and see if they produce results in normal parameters.
Ok, then if you believe this is still an issue, reopen it.
Timeout. Closing
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.