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.

Bug 204682 - Save action is done in AWT
Summary: Save action is done in AWT
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords: PERFORMANCE, PLAN
: 207444 (view as bug list)
Depends on:
Blocks: 206311 209081
  Show dependency tree
 
Reported: 2011-11-04 12:56 UTC by Petr Cyhelsky
Modified: 2012-03-28 07:33 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktrace (4.33 KB, text/plain)
2011-11-04 12:56 UTC, Petr Cyhelsky
Details
stacktrace (4.56 KB, text/plain)
2012-03-19 08:53 UTC, Exceptions Reporter
Details
stacktrace (4.54 KB, text/plain)
2012-03-19 11:32 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cyhelsky 2011-11-04 12:56:01 UTC
Created attachment 112836 [details]
stacktrace

Please see the attached stacktrace.

This stacktrace was obtained during performance team search for usages of
outputStream in AWT - this often causes slowness when caught by versioning or
local history.

If it is impossible to do this off awt can it at least be run
using runOffEventDispatchThread?
Comment 1 Miloslav Metelka 2011-11-07 15:09:43 UTC
It would be a bad idea to do the Save operation on background. For consistency I just want to make sure the document was saved before I continue typing.
You could possibly gain some little performance improvement by using a background thread for the save operation and wait for completion of that thread but it's not worth the effort. The save thread will require document's write lock (due to save actions such as trailing whitespace removal) and repainting of editor pane requires read lock so once editor pane's repaint would occur the paint operation (i.e. the AWT thread) would be stuck waiting for completion of the save operation anyway.
Comment 2 Petr Cyhelsky 2011-11-07 16:18:09 UTC
The problem is, that when save action is done in awt without wait cursor or without using runOffEventDispatchThread it can (and does) cause slowness when this operation is caught by versioning. Please add at least the wait cursor in 7.2 scope...
Comment 3 Tomas Hurka 2012-01-06 12:24:42 UTC
It must be fixed for 7.2.
Comment 4 Miloslav Metelka 2012-01-17 10:13:57 UTC
So the replanning from EDT into background thread will be done in SaveAction in platform/actions by Yarda,
The CloneableEditorSupport.saveDocument() may remain the same: before save actions (currently just remove-trailing-ws) will be write-locked and the actual save will be read-locked.
I will implement a functionality that will allow the document to be rendered even when the document is write-locked. Besides the before-save-actions it will be usable for document reformatting.
Comment 5 Vladimir Voskresensky 2012-01-18 13:28:02 UTC
responsiveness of editors based on writable remote file objects is affected by this issue
Comment 6 Petr Cyhelsky 2012-01-18 15:19:22 UTC
*** Bug 207444 has been marked as a duplicate of this bug. ***
Comment 7 Petr Cyhelsky 2012-03-05 09:33:13 UTC
*** Bug 209081 has been marked as a duplicate of this bug. ***
Comment 8 Exceptions Reporter 2012-03-19 08:53:17 UTC
Created attachment 116852 [details]
stacktrace

trying to save the php file (upload on save over ftp enabled)
Comment 9 Vladimir Riha 2012-03-19 11:32:16 UTC
Created attachment 116856 [details]
stacktrace

fast typing in php file and saving it (which caused uploading the file to FTP - upload on save feature)
Comment 10 Petr Cyhelsky 2012-03-28 07:33:55 UTC
fixed by jarda in af7375b814a8