From: http://www.doserv.com/article/2012/0831/5299117.shtml
Other aspects
I have already elaborated on the four main aspects that affect performance. However, there are some important aspects that need to be mentioned. The major aspects may be attributed to your platform or system environment:
How does your storage subsystem perform big data read/write and small data read/write, instant read/write and sequential read/write? What are the pre-read and delayed write operations?
How efficient is the network protocol you are using? Can I improve performance by modifying parameters? Is there any data similar to tcp_cork, msg_push, and Nagle-toggling?AlgorithmTo avoid the generation of small messages?
Does your system support scatter-gather I/O (for example, readv/writev )? Using these methods can improve performance and avoid the hassle of using a buffer chain (see section 1 data copy description. (Note: The Source physical address and target physical address must be continuous during the DMA data transmission process. however, in some computer systems, for example, IA, continuous storage addresses are physically not necessarily consecutive, and DMA transmission is divided into multiple times. if an interruption is initiated after a piece of physical continuous data is transmitted, and the host performs the next physical continuous transmission, this method is block DMA. the scatter/gather method is different. It uses a linked list to describe physically discontinuous memory, and then tells DMA the first address of the linked list.
Master. after the DMA master transmits a piece of physical continuous data, it does not need to be interrupted again. Instead, it transfers the next physical continuous data based on the linked list, and finally initiates an interruption. obviously, scatter/gather is more efficient than block DMA)
What is the page size of your system? What is the cache size? Is it useful to pair these large and small boundaries? What is the cost of system calls and context switching?
Do you know the hunger of lock primitives? Is there a "surprise group" Problem with your event mechanism? Does your wake-up/sleep mechanism have such bad behavior: When x wakes y, the environment immediately switches to y, but there is still unfinished work in X?
I have considered many aspects here, and I believe you have considered them too. under certain circumstances, some aspects mentioned here may be of no value, but it is still useful to consider the effects of these factors. if you have not found any description in the system manual, try to find the answer. write a testProgramTo find out the answer; in any case, write such a testCodeThey are all good skill exercises. if the code you write has been run on multiple platforms, You can abstract the code into a platform-related database. In the future, on a platform that supports some of the features mentioned here, you have won the lead.
For your code, "Know what it is", understand the advanced operations, and the costs under different conditions. this is different from the traditional performance analysis. It is not about the specific implementation, but about the design. low-level optimization is always the last treasure for poor design. map note: the original text below does not exist. This is the translator's understanding of translation.
Appendix: Odysseus, also translated as "Odyssey", the mythical king of itakai, the protagonists in Iliad and Odyssey (the Greek history from the 11th century to the 9th century BC is referred to as the "Dutch age ". this is a famous masterpiece in the ancient world, which consists of Iliad and odyssey ). he once participated in the famous Trojan war. During the war, he was famous for the brave and resourceful battles. To win the war, he designed and created the famous "Trojan Horse" (and later became synonymous with "gifts for the destruction of the enemy" in the west ). after the destruction of the city of Troy, he experienced a lot of risks on his way back home. The Odyssey of HOMA is the story about the adventure of odisus.
The story of "scuula and carrupdis" is one of the most thrilling and scary scenes.
According to legend, coquola and carrupdez are the female and monsters in ancient Greek mythology. The female coquola lives in a cave in the strait between Italy and Sicily, and lives opposite another gender, carrupdez. they harm all those who used to sail. according to Homa, the female sikura has 12 irregular feet and six snakes in the same neck. Each neck has a terrible head and a huge mouthful of blood, each mouth has 3 detoxifying teeth, ready to crush prey at any time. every day, they make waves in the straits between Italy and Sicily. It is extremely dangerous for navigators to pass between two monsters. They are always waiting for ships to pass through the sisily strait. in the middle of the strait, carrubra is transformed into a large vortex, with surging waves and splash of water. Three times a day, he rushed out of the cliff. When he recede, he drowned all the vessels here.
When the ship of Odyssey approaches the great vortex of carrubra, it is like a pot of boiling water on a stove, which is so cool that the sky is filled with snow and white water. when the tide recede, the sea water turbidity, sound as thunder, earth-shaking. at this moment, the dark and muddy rock holes can see to the end. while they watched this terrible scene in terror, while the pilot carefully drove the ship from left to bypass the vortex, suddenly hybridla appeared in front of them, she swallowed up six companions. oddus saw his companions twisting their hands and feet in the teeth of the monster, struggling for a while, and they were chewed up and turned into a blood blur. the rest were lucky enough to pass through the dangerous loose between the Great vortex of carapos and the hybridla. later, after all kinds of disasters, I finally returned to my hometown, etachi Island.
This story has been widely used in the language field and translation field. Prior to the Soviet Union, the famous interpreter barhodarov once compared "Scala and carrupdeis" to "literal translation and free translation" in translation ". he said: "In an image, the translator always has to make a detour between the literal translation and the free translation, as if he had to make a twists and turns between slura and kalapos, in order to find a narrow, yet deep, channel between the two sides of the Taiwan Strait, in order to reach the ideal destination-the maximum equivalent translation."
The famous German linguistics Hong bao also said something similar: "I am sure that any translation is undoubtedly an attempt to solve the impossible task. because any translator will encounter a reef and fail, they do not destroy the characteristics of the translation language because they strictly abide by the original form, the original text is damaged to take care of the characteristics of the translation language. the practice between the two is not only difficult, but also impossible."
For a long time in history, we have always believed that translation can only choose one of the two extreme types: -- literal translation (literal translation) or -- free translation (free translation ). it's like the translation of scala and carrudedes. Today, scula and carrupdeis have become synonymous with both risks-the sea monsters and the vortex. It is often said that between scura and karrupdeis, this is to say: in the threat of both sides of the enemy, this metaphor is used to express the difficulty of making repeated choices between literal translation and free translation.