You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Kelly Campbell <ca...@merlot.channelpoint.com> on 2001/04/02 04:59:11 UTC

Re: [PATCH] fo.FOText - Bugfix for small-caps in static content becomes all-caps [1171]

On Mon, Apr 02, 2001 at 11:52:14AM +1000, Daniel Bradby wrote:
> 
> 
> The patch creates a temp array to manipulate this data in. But as Kelly
> is trying to improve object allocation, maybe this isn't ideal.
> 

Thanks for the patch Daniel. I just wanted to point out not to let
"premature optimization" affect implementations. In other words, creating
a temp array is fine. The area-before layout is probably a corner case
ayway. Most of the optimizing I did was in stuff that got called for every
word or every character in a document.

The first rule of optimizing is only do optimizations after using a 
profiling tool. This lets you find the 20% of code that is taking
80% of resources.

In the case of what I worked on this weekend, the tools found that we were
doing font lookups for every character, even though there was no way for
the font to be changed in that particular case. Fonts can change per
character, but it requires a inline formatting object.

The other major area highlighted by the tool was renderWordArea in
PDFRenderer was creating objects (mainly Strings, StringBuffers, and
PDFColors) unneccessarily. Most of this was due to a couple of
refactorings that have happened since the original code was written. In
one case we were appending an empty string plus the word every time. :-)

-Kelly
-- 
Kelly A. Campbell              Software Engineer
<ca...@merlotxml.org>           ChannelPoint, Inc.
<ca...@channelpoint.com>        Colorado Springs, Co.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: [PATCH] fo.FOText - Bugfix for small-caps in static content becomes all-caps [1171]

Posted by Kelly Campbell <ca...@merlot.channelpoint.com>.
On Mon, Apr 02, 2001 at 01:04:33PM +1000, Daniel Bradby wrote:
> Did you run the profiler with the AWT renderer at all? Just interested.

Nope, I mainly looked at PDF rendering, but some of the hotspots showed up
in code that gets called no matter what renderer is used. Unfortunately, I
probably can't give out the code I used to do the profiling because it
requires hacks to java.lang.Object which is against the JDK license to
distribute and the other code is pretty much copied out of the Performance
Tuning book verbatim.

-Kelly
--
Kelly A. Campbell              Software Engineer
<ca...@merlotxml.org>           ChannelPoint, Inc.
<ca...@channelpoint.com>        Colorado Springs, Co.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: [PATCH] fo.FOText - Bugfix for small-caps in static content becomes all-caps [1171]

Posted by Daniel Bradby <da...@bjs.com.au>.
> In the case of what I worked on this weekend, the tools found that we were
> doing font lookups for every character, even though there was no way for
> the font to be changed in that particular case. Fonts can change per
> character, but it requires a inline formatting object.

I've had a bit of a look at the AWT font rendering code and found it
only does font metric lookups etc when the font has changed. Maybe that
could be pulled out at some stage if you are using and inline FO to
detect this change now? Sounds like you've had quite a bit of fun anyway
:)

Did you run the profiler with the AWT renderer at all? Just interested.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org