Discover java performance tuning and optimization, include the articles, news, trends, analysis and practical advice about java performance tuning and optimization on alibabacloud.com
Loop and string processing are worth noting during system performance optimization. In terms of mentality, we must not put our own eyes on ten or hundreds of cycles, nor treat the strings we want to process as ten or twenty characters. Every time a loop is encountered, it should be assumed that the loop is more than ten thousand times. Each time the string to be processed, you must tell yourself that the st
knowledge of Java heap and garbage collection is critical to the performance tuning of applications;
Java stack: Java resource JVM is a Java-based stack operating mechanism, with an exception, dalvik, the android Virtual Machi
Java program performance optimization: code optimizationNow the processing performance of the computer is getting better and better. In addition to the optimization of some code by the JDK upgrade, the Code layer may not be able to adjust some details, but I think the
when running with Java applet * Optimized@authorHu Jinshui **/ Public classBuffermovingcircleextendsnobuffermovingcircle{Graphics DoubleBuffer=NULL;//buffers Public voidinit () {Super. Init (); DoubleBuffer=Screenimage.getgraphics (); } Public voidPaint (Graphics g) {//use buffer to optimize the original paint () methodDoublebuffer.setcolor (Color.White);//draw in memory firstDoublebuffer.fillrect (0, 0, 200, 100); Drawcircle (
), which is the cause of the difference in performance. Even so, the advantages of using NIO cannot be concealed. Using NiO instead of traditional I/O operations, optimization of the overall performance of the system should have an immediate effect.
Appendix
Bit: "Bit" is the smallest unit of data in an electronic computer. The status of each bit can only be
final variable" format is a good choice.2. Avoid unnecessary creation as much as possible, while avoiding using static variables arbitrarilyGC usually does not reclaim the memory occupied by static variable objects, so use static area code reasonably.3. Use basic data types instead of objectsIn Java, a string object consists mainly of 3 parts:The length of the char array, offset, and string.// creates a "hello" string, and the JVM's character cache p
. (Note: If the table is statistically analyzed, Oracle will automatically link the small table and then the large table)3. Utilization of SQL statement indexes(a) Some optimizations for the condition fieldsFields that use function processing cannot take advantage of indexes such as:substr(hbs_bh,1,4)=’5400’优化处理:hbs_bh like ‘5400%’trunc(sk_rq)=trunc(sysdate)优化处理:sk_rq>=trunc(sysdate)andsk_rqFields that have an explicit or implicit operation cannot be indexed, such as:ss_df+20>50优化处理:ss_df>30‘X’|
Java performance optimization (I)
Huang Weifeng
After the emergence of Java in the middle of 1990s, it attracted some criticism while winning praise. What I have won is mainly the cross-platform operability of Java, the so-called "write once, run anywhere ". however, the
. They basically implement a cache algorithm such as Fifo/flu.21. Try to avoid very large memory allocationsSometimes the problem is not caused by the heap state at the time, but by the failure of the allocation. The allocated memory blocks must be contiguous, and as heap heap becomes more and more full, it becomes increasingly difficult to find larger contiguous blocks.22. Caution With exceptionsWhen creating an exception, you need to collect a stack track, a stack trace that describes where th
Performance | Optimization Java in the mid-90, after the emergence of praise, but also attracted some criticism. The winning admiration is mainly Java's cross-platform operability, the so-called "Write Once,run Anywhere". But because Java performance and operational efficien
Performance | Optimization Java in the mid-90, after the emergence of praise, but also attracted some criticism. The winning admiration is mainly Java's cross-platform operability, the so-called "Write Once,run Anywhere". But because Java performance and operational efficien
for Java performance More concerned about the students probably know the "Java performance" this book, in general, many students in the daily writing Java Code is seldom to care about performance issues, but in the process of writ
GIS image cutting performance tuning and GIS image Performance TuningStatus Quo and objectives
DellR920 Server, virtualized vmware vsphere 5.5 system, Guest System Windows Server 2012 R2. Deploy software ARCGIS 10. Image graph cutting test: the original cut takes 70 hours, And now it takes 17 hours. There is still room for further
This book provides a detailed introduction to the fundamentals of Java virtual machines and the optimization of diagnostic methods. It focuses on the Java Virtual Machine architecture, common virtual machine parameters, Java Virtual Machine garbage collection principle, algorithm and the current virtual machine support
collector of the old generation uses the marking and clearing algorithm. When the collector recycles the object, it merges the adjacent space and assigns it to a large object. However, when the heap space is small and runs for a period of time, "fragments" will appear. If the concurrent collector cannot find enough space, the concurrent collector will stop, then, use the traditional marking and clearing methods for recycling. If "Fragmentation" exists, you may need to configure it as follows:
creating a large number of threads (in better cases, a buffer pool is used). This technology can be seen in many applications that must support concurrent I/O flows, such as Web servers, quotes, and auction applications. However, creating a Java thread requires considerable overhead.JDK 1.4 introduces a non-blocking I/O library (Java.nio). If your application requires an earlier version of the JDK, there is a package that supports non-blocking I/O.Se
Skills | experience | performance | optimization
One, general article
The issues discussed in "common article" are appropriate for most Java applications.
1.1 Create an instance of a class without the New keyword
When you create an instance of a class with the new keyword, all constructors in the chain of the constructor are invoked automatically. But if an obj
Outline:
I. Overview
2. What is performance tuning? (What)
3. Why performance optimization? (Why)
4. When do I need performance optimization? (When)
5. Where do I need performance
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.