jfree / jfreesvg

A fast, lightweight Java library for creating Scalable Vector Graphics (SVG) output.
http://www.jfree.org/jfreesvg
GNU General Public License v3.0
319 stars 58 forks source link

Performance improvement: omit transformation if it's the identity matrix #14

Closed mquinson closed 6 years ago

mquinson commented 6 years ago

In my project, which generates thousands of svg in a very short amount of time, transformDP is a major performance killer. This is a pitty because I do not use transformation matrices (I precompute the transformations and generate the shapes with the right coordinates directly).

This patch greatly helps the performance my code, with no rendering difference for my svg files. In addition, the svg files are much smaller too.

I eagerly wait for your comments on my change. If you like it, other will come.

jfree commented 6 years ago

I recall considering this approach when i first wrote the code, and I forget why I didn't do it. Perhaps it was just an omission. I'll check if I can find some reason, but I don't see an obvious problem, and the benefit is significant.

Are you OK with assigning copyright on the modifications to Object Refinery Limited? I need to confirm this, because of the dual licensing.

mquinson commented 6 years ago

Yes, I agree on assigning the copyright on all my modifications of jfreesvg to Object Refinery Limited. I did several other perf improvements on my version, and I just wait for you to accept this one before proposing the other ones.

mquinson commented 6 years ago

Hello,

is there anything I could do to get this PR integrated?

Thanks, Mt

jfree commented 6 years ago

Merged.