PuffinPlot issue tracker

Bug: a88/bee

ID : bee7cac3-8338-4e06-8ac2-34ccb1e35d4d
Short name : a88/bee
Status : fixed
Severity : minor
Assigned :
Reporter : Pontus Lurcock <pont@talvi.net>
Creator : Pontus Lurcock <pont@talvi.net>
Created : Fri, 14 Aug 2009 00:24:10 +0000
Target : 1.5
Summary : Optimize TextLinePoint constructor [112]

Comment: --------- Comment ---------
ID: f6f9feb8-2b6c-475f-ba3b-7d92af9e97db
Short name: a88/bee/f6f
From: Pontus Lurcock <pont@talvi.net>
Date: Fri, 14 Aug 2009 00:24:10 +0000

A quick-and-dirty profiling of PuffinPlot while stepping through a
suite of samples reveals the following breakdown of the event queue:

81% GraphDisplay.paint, which includes
60.5% DataTable.draw, which includes
44% TextLinePoint.<init>, which includes
27.5% TextLayout.<init> and
12.9% TextLayout.getBounds

DataTable.draw also spends 12.1% of time in String.format.

So there are huge time savings to be made if this can be improved in 
any way. A Big Dumb Cache is the obvious approach, but perhaps 
improvements can be made in the way the Java2D API is being used. If
caching is going the be done, would it be better to institute a 
more general system for caching whole Plots?

Comment: --------- Comment ---------
ID: 2b347b55-4b7b-499a-bb63-c8b8e73bc5a0
Short name: a88/bee/2b3
From: Pontus Lurcock <pont@talvi.net>
Date: Fri, 14 Aug 2009 00:45:48 +0000

If this can be optimized neatly by smarter use of TextLayout, it should
be. Caching plots is a nice idea, but so low-priority compared to approx.
30 other issues that it will probably never be worth doing.

Comment: --------- Comment ---------
ID: 5f0320c9-3659-44dd-bc67-7373766bccd5
Short name: a88/bee/5f0
From: Pontus Lurcock <pont@talvi.net>
Date: Fri, 14 Aug 2009 09:08:17 +0000

Took out the TextLayout, but I'm suspecting the original profiling
may have been dodgy since it only shaved a few percent off. Profiling
again shows fairly even division of painting time between the plots
and no obvious candidates for easy improvement (drawing points being
the most evident time sink). Anyway, the TextLayout has been replaced
with an AttributedCharacterIterator, with a FontMetrics to determine
the bounding box.