Performance VS structure

xiaoxiao2021-03-06  60

The MVC mode under Delphi was simple first two days. I didn't expect to have problems. I thought that when I arbitrarily argued that I didn't have to use MVC. I was in trouble. It was not enough to express my skill. , Sweat, the retribution is really fast.

In fact, it is not a big problem. TA has 3 properties, each change will change, TB contains 2 attributes, each change will update the 3 attributes of the internal TA, and I have changed the two properties of TB once, Change 6 Time. This is avoided by increasing the triggering and opening the triggered interface outside. However, this trigger mechanism is not transparent to the user.

There are also interfaces that do not need to be updated, in fact, this is lazy reason, did not subdivide the Change event, not to say. In addition, there is a problem that is too slow to slow down, and now use a dedicated thread to call the listening event.

There are also some redrawn functions that are discovered today, which triggered the Model's Change, and the result is cycling. This is a problem with the logic, that change can be avoided, on the other hand, avoiding this trigger again when the event is handled.

In fact, it is a small problem, but once accumulated, it is possible to make the entire structure can't run. It seems that there is no complete set of methods now to avoid the system. I remember that there is a matter of the anti-mode in Java in the previous paragraph, there is a lot of performance. This will understand that many Java programs have poor performance, in fact, it is not necessarily the limitations of language, and more is the design from the perspective of structures tend to ignore performance. That is, the current design method guarantees the logical integrity of the concept (object), but does not have a global entity for the collaboration. Programmers need to be avoided through experience.

In addition, today I really encounter a performance problem, from the customer's point of view, the time complexity of 100 × 100, generally does not have problems, but because the service is calculated every time, this calculation is 100 time complexity (which is not only, there are 5 to 7 calibration depths per 100), and the complexity of this time is a bit big. It seems that the cycle depth is a hurdle.

Similar to the previous problem, the object separation makes each logic part increases independence in the structure, while reducing the complexity of each portion, it is unintentionally masked with some overall system operation, although as long as there is a certain level. Developers can avoid and improve this problem. But first, it is really prone to problems. In addition, the general solution will increase overhead or complexity, and even in the case of misuse, performance is not in the bottleneck, and finally, performance issues are often an old programmer. Reject one reason for object-oriented.

I feel that this problem is like a pointer operation in C, although it can be used in theory, but there is not enough experience and skills and careful things. In the end, I think this problem should be constructed by a programming language or framework.

At present, I have not optimized this part. In some cases, I feel that I have not until I can't endure, but it is almost almost that I have not fully analyzed the reason for the performance. You should find a tool for performance diagnosis.

转载请注明原文地址:https://www.9cbs.com/read-114146.html

New Post(0)