You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Konstantin Priblouda <kp...@yahoo.com> on 2002/09/24 11:29:22 UTC

Re: fop performance

--- Laszlo Hornyak <lh...@ish.hu> wrote:
> Hi all!
> 
> I would like to adopt FOP for the developements of
> the company. 
> Unfortunately, everyone here says it`s performance
> is too low.
> This is a fragment of the source code from
> PDFStream.java:
> 
> 
>     /**
>      * Output just the stream data enclosed by
> stream/endstream markers
>      */
>     protected int outputStreamData(OutputStream
> stream) throws IOException {
>         int length = 0;
>         byte[] p = "stream\n".getBytes();
>         stream.write(p);
>         length += p.length;
>         _data.writeTo(stream);
>         length += _data.size();
>         p = "\nendstream\n".getBytes();
>         stream.write(p);
>         length += p.length;
>         return length;
> 
>     }
> 
> Wouldn`t it be faster with the following?
>    
>      [...]
>     static final byte[] kwd_stream =
> "stream\n".getBytes();
>     static final byte[] kwd_endstream =
> "endstream\n".getBytes();
>     /**
>      * Output just the stream data enclosed by
> stream/endstream markers
>      */
>     protected int outputStreamData(OutputStream
> stream) throws IOException {
>         int length = 0;
>         stream.write(kwd_stream);
>         length += p.length;
>         _data.writeTo(stream);
>         length += _data.size();
>         stream.write(kwd_endstream);
>         length += p.length;
>         return length;
>     }
> 
> What is the reason FOP wroks with runtime created
> strings?

If you know how to made it better do:

1. Change code and see for yourself if it works
and improves performance
2. Make patch and submit it to developers


It's open-source :)
( and your solution looks sane )

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

Re: fop performance

Posted by Konstantin Priblouda <kp...@yahoo.com>.
> Sorry, this was realy a question, I didn`t want to
> criticize the source.

What's bad on criticizing open source source?
That's why it's open - everybode can propose
improvements... :)

> 
> >2. Make patch and submit it to developers
> >
> I can not do that. I am working for a company, and I
> am afraid this step 
> would cost my job :(
> (and it is not easy to find another here ;)

Well, nobody can prohibit you to do it at home. 
And I had no problems (while working on contract)
to say the managers:
hi guy, we are using this cool product "xdoclet",
and it lacks feature which could save us a lot of pain
and time. I can develop this, but from home, and it
shall be submittet to main repository or else we 
will be unable to use next improved vesrion.

This way I was able to stay a day at home, while being
paid from project :)

( and here is also not a lot of jobs right now... )

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

Re: fop performance

Posted by Laszlo Hornyak <lh...@ish.hu>.
Hi!

Sorry, this was realy a question, I didn`t want to criticize the source.

>If you know how to made it better do:
>
>1. Change code and see for yourself if it works
>and improves performance
>
in progress.

>2. Make patch and submit it to developers
>
I can not do that. I am working for a company, and I am afraid this step 
would cost my job :(
(and it is not easy to find another here ;)

>
>
>It's open-source :)
>( and your solution looks sane )
>
thx :)

>
>regards,
>
>=====
>Konstantin Priblouda ( ko5tik )    Freelance Software developer
>< http://www.pribluda.de > < play java games -> http://www.yook.de >
>< render charts online -> http://www.pribluda.de/povray/ >
>
>__________________________________________________
>Do you Yahoo!?
>New DSL Internet Access from SBC & Yahoo!
>http://sbc.yahoo.com
>
>
>.
>
>  
>