| Summary: | [GC] font property is rendered multiple times under certain constellation | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ivan Furnadjiev <ivan> | ||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | christian.campo, elias | ||||||
| Version: | 1.3 | ||||||||
| Target Milestone: | 1.4 M2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 322697 | ||||||||
| Attachments: |
|
||||||||
|
Description
Ivan Furnadjiev
Created attachment 176962 [details]
Test case
This issue has been observed in Riena, running on top of RAP. Riena uses a pattern like:
----
GC gc = new GC( this );
gc.setFont( font );
FontMetrics metrics = gc.getFontMetrics();
....
do some calculations
....
gc.dispose();
----
in their SWT computeSize or similar methods, which leads to sequence of equals SetFont operations in GCAdapter#gcOperations list. As a result, javascript code gc.setProperty( "font", "..." ) has been rendered multiple times. In Riena SWT example application I count 290 usless
set font renderings in every request/response, which increases the size of rendered javascript a lot.
Created attachment 176963 [details]
Patch to solve the problem
Add new SetFont operation to the list with gc operations (GCAdapter#addOperation) only if the font of last SetFont operation differ.
Apply patch to CVS HEAD. As a result of the patch, the number of gc.setProperty( "font", "..." ) renderings in Riena SWT Example App has been reduced from 290 to 12 and the size of request/response data from 40k to 10k. This reduced the browser CPU usage 3 times as well. Cool! Thanks! Fixed in a different way with bug 323116. |