Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 410312

Summary: Optimization of ScaledGraphics: fonts management.
Product: [Tools] GEF Reporter: Sergey Sharov <zefick>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: nyssen, zefick
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch for ScaledGraphiks. none

Description Sergey Sharov CLA 2013-06-10 05:26:45 EDT
Created attachment 232164 [details]
patch for ScaledGraphiks.

Some times ago I have found a bottleneck in ScaledGraphics's font management. This is reflected in the fact that the thumbnail of diagram with just a few tens of text elements begins to slowly scroll. My research showed that the reason of this is the numerous calls of Font.getFontData() method. This method is very expensive in Windows OS. I have rewrote the getCachedFont() method in Scaled graphics to avoid it. Now it caches FontData by reference to the font and caches references to zoomed fonts also. Scrolling works well now.

Please revise my diff and integrate it in GEF 3 if possible.
Comment 1 Alexander Nyßen CLA 2014-07-16 10:17:44 EDT
We have optimized part of this already in bug #41208, so I will resolve this one as WORKSFORME. Please take a look into the changes and reopen this one in case you think further optimization is needed.