Add TPTP plugin in eclipse

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/sinboy/article/details/1536625

In practical application, the impact of large data volume on the system itself is a problem that has to be faced.

The earliest use of JBuilder, it has a matching tool called Optimize Suite, can be used in JBuilder, but also can be used independently, it can monitor the running of concurrent thread data, memory usage, etc., is not a very good performance test suite. Unfortunately with the decline of jbuilder it also gradually disappeared in the eyes of people. I remember there was also an independent performance test tool called Jprofiler, which can be seen from the name of what it was used for, and it seemed to be a highly praised tool.

After Eclipse's rise, plug-ins are rapidly becoming popular, and I like the "on-demand" model and add anything to it. Before the performance of this aspect of consciousness is not very strong, but the last time a lesson, slowly change the attention. People always get the color after they've had some lessons:)

The first thought was from the Eclipse official website to look for, did not let me disappoint. Eclipse official has a test & performance Tools Platform (TPTP) project, very early, but has not previously been concerned about, now the latest stable version is 4.3.1. Can carry out the statistical analysis of program execution time, memory monitoring, object invocation analysis, etc., I am now concerned about the function is execution Statistics (program execution statistics), can show the program of the 10 most expensive method is the bottleneck of the system. Finding the bottleneck, we can find ways to solve it, or optimize or rewrite, the right remedy, no more lose.

In fact, the use of TPTP is very simple, but in the download use must pay attention to the TPTP plug-in itself version and Eclipse version of the match, otherwise it will probably repeat I even tried several times can not run correctly. Here's a brief look at the steps to install and use:

1. Download the TPTP4.3.1 version from the Eclipse official website, and its corresponding eclipse version is 3.2.2, as shown in:

Figure A

2. After the installation is complete, restart Eclipse, and if necessary, add the parameter-clean to clean it up. If installed properly, the shortcut icon for TPTP is displayed in the standard button column, which is shown in two:

Figure II

3. Select the main class of the project you want to perform the performance test on, right-click on the main class, the profile as on the menu, and then select Java application. Of course, if your project is not a Java application, but a Web program, you will also need to install the appropriate Web plugin WTP, select Profile on serve, as shown in three:

Might

4. After that, a window is displayed that selects the monitoring item, which has three default monitoring items: Memory analysis (Basic test), Execution time analysis (Executeion- Coverage), as shown in four:

Figure Four

5. Click the OK button, the program starts running, and the monitoring will also start, and Eclipse will switch the monitoring view as shown in five:

Figure Five

6. Double-click on the project to see the specific monitoring results, as shown in six:

Figure Six

7. From the above monitoring results, it is clear that the system is the most expensive method of the present, it is strange that these are not special in the usual way how can there be so much overhead? Careful analysis of the code found, each time after using data, before and after processing to determine whether the sender is a mobile number or a unicom number, in judging the number and then called the full-width of the string method Quan2ban (String str). Oh, that's it. Although the full-width figure is taken into account in the full turn half, the probability of the actual system running is almost no, so it is possible to remove the Quan2ban () method from it, and the overhead is greatly reduced. The same is true of the Isallchinese () method, which is again tested after the code is adjusted, as shown in seven:

Figure Seven

8. Although there have been significant improvements, the two methods seem to have been called multiple times, what is the problem? A further analysis of the invocation of the method, we know that in the program initialization Dictionary library, will use the two methods, but the initialization does not affect the normal processing of the system, you can first block the initialization process, test again, the results as shown in eight:

Figure Eight

9. Strangely, the most expensive is the four class constructor, really confused, the constructor does not do what operation, how can there be so much overhead? Besides, I've just been testing the creation of objects, almost without spending much. After careful study, I found that the output of the log I used log4j this useful tool, and in order for the log output to be able to follow my own custom, each class at the time of creation I have called one such sentence: Propertyconfigurator.configure ( CONFPARAM.LOG4J_PROP_CONF); Is it the reason for loading configuration parameters? The problem is eliminated by shielding it from the sentence. One by one the method of large overhead is analyzed and optimized, and the processing ability of the system is improved greatly.

In the study of TPTP, I mainly used the execution time analysis of this monitoring function, because the main problem of my system is in the efficiency of execution, if it is a memory overhead problem, you can focus on memory analysis. Of course TPTP has other very powerful functions, which need further study and study.

Tip: When using TPTP for performance testing, the system startup time and run time may be far beyond the normal running time, I originally normal 1 minutes to complete the initialization process, enabled TPTP after 10 minutes, Halo ...

Add TPTP plugin in eclipse

Related Article

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.