Issue Details (XML | Word | Printable)

Key: SIMPLEVALIDATION-49
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: jglick
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
simplevalidation

GraphicsDevice.getCurrentDisplayMode expensive

Created: 17/Nov/11 07:28 PM   Updated: 17/Nov/11 08:26 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment:

Ubuntu Oneiric, JDK 6u29 32-bit


Tags:


 Description  « Hide

I get a bunch of UI freezes on Ubuntu in NetBeans related to this library, e.g. Tools > Options > Miscellaneous > JavaCard, which the self-profiler indicates result from sun.awt.X11GraphicsDevice.getCurrentDisplayMode taking several hundred msec per invocation. Consider whether these calls (e.g. from MultilineLabelUI.getMaximumSize) are really necessary. The resulting width value seems to only be used when there is no parent, and in this case does it matter what the minimum or maximum size is?



tim added a comment - 17/Nov/11 08:26 PM

Not sure what it's used for if there's no parent; perhaps it should go away. At any rate, invocation of c.getGraphicsConfiguration().getDevice().getDisplayMode().getWidth() could be conditional on there being no parent; and the result could be cached (it would be incorrect if the screen resolution changes, but that's rare enough that we might choose not to care, or listen for changes in it if we want to be pedantic).

Or, for that matter, just using a value like 1024 or 1280 hard-coded would probably be fine enough.