The problem and solution of Birt performance

Source: Internet
Author: User

Today, colleagues have a Birt performance problem to solve, the problem is embedded in the Birt a paragraph of our own code to invoke some existing classes to get the database information configured in the file, because the database username and password is encrypted, It cannot be written directly in the Rptdesign file, but only by invoking the previously existing class to get the database information. Each time this class is invoked, it causes Birt to produce reports that are particularly slow, and the CPU remains high, and if these classes are not invoked, the same query conditions, the same data, the same database will quickly return, the time difference is 25-30 times.
The first thing to think about this problem is that Birt is embedded JavaScript statements in the Rptdesign file, and whether Birt will reload the classes we use. So we added a static field to those classes and added some log to the static domain and constructor. As a result, the static domain is only executed once, and that is, the classes are not loaded repeatedly. The idea is not right.
Then think of each time because of the special consumption of CPU, so use the JDK6 JVISUALVM to profile, and then the environment to JDK6, start profiles CPU information, the results found that the CPU time-consuming place is not Birt and our own class, And it's a system class that doesn't see anything special in this information, so the idea is also ruled out.
Finally, think of is not can dump thread information in the CPU particularly busy time, so we dump a lot of data, start analyzing thread information. This is something that we find very special when the CPU is particularly busy--the thread that produces the report in Tomcat--especially since it has a very long stack of information that can be seen at a glance and is related to the JavaScript library where Birt already has Mozilla. Moreover, in these group data, although the topmost stack does not stay in the same position, there is a Importpackage method information for Mozilla JavaScript in the middle of the stack. So find rptdesign file, found in the code is sure to have importpackage (packages.x.y.z); see here is not the importpackage there is a problem, so the sentence to delete, Then at the bottom of the call when all use the full path of the class, a try, sure enough problem.
But the reason is not clear, and then slowly find it later.
Conclusion: Thank God, I was so lucky that I accidentally took care of it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.