Hmmm...
I've been dealing with similar needs for the past few days. I hadn't
noticed any slowness, but then again the reports we're generating are
slow to start with (couple of seconds to generate). So I did some
testing: encoding a 200 long string took on my laptop (first set is
different due to OS-level caching):
First set:
First run: 327ms
Next 100: 307ms TOTAL!
Next sets:
First run: 70-90ms
Next 100: 300-320ms TOTAL!
This is the encoding and conversion to a BufferedImage.
When encoding to PNG using ImageIO I get:
First set:
First run: 480ms
Next 100: 370ms
Next sets:
First run: 110-130ms
Next 100: 440-470ms
This is to say, that if there is any slowness it's possible it's
somewhere else, and not the actual QR code generation.
Now I do use Jasper Reports in a J2EE environment, and might have
differences, but I dug deeper and found, that Jasper encodes the image
into a JPeg/PNG (depending on whether the image has alpha channel).
The Matrix-To-Image-Writer generates an opaque image, that I suppose
gets compressed into a JPeg.
It's also possible, that there is some weirdness with the class-loading.
You should try to replace the QR code generation expression with a
plug and see if its similarly slower:
<imageExpression class="java.io.InputStream"><![CDATA[ new
java.awt.image.BufferedImage(600, 600, 1) ]]></imageExpression>
2013/4/5 Alonso Vergel <
ave...@dps.com.co>: