Performance - template compiling and image



I have a question. I am a beginner in jasper and I have to know if is difference in performance between defining an image in a template static or dynamicaly via parameter.

For example I can define the image in template like this:

1) setting parameter

URL url = this.getClass().getClassLoader().getResource("pdf/my_image.tif");
parameters.put("logo", url);

declaration in a template

<parameter name="logo" class="">

usage in a report/template

   <reportElement x="100" y="30" width="135" height="30"/>

2) defines the path in the template

<imageExpression class="java.lang.String">
      <![CDATA[$P{REPORTS_DIR} + "/images/logo.jpg"]]>

Is needed compiling the template repeatedly (see 1)? Is difference between 1 and 2 in performance?

Thank you in advance

Pavel Slavicek

slavicekpavel's picture
Joined: Aug 1 2016 - 3:06am
Last seen: 4 years 9 months ago

0 Answers:

No answers yet