Development speed and Running Speed

Source: Internet
Author: User

Chairman Mao taught us that the unity of opposites is universal, everything has two sides, and software development is the same. There is a unity of opposites between the development speed and the running speed.

There is a point of view that computer hardware is developing rapidly, software can be swollen, and computer hardware can quickly make up for this problem. Some people are opposed to this idea, all of which are based on single chip microcomputer.ProgramLet's talk about things.

I agree with this idea. Based on my personal software development experience, for most of the application software for information management on ordinary PCs, it can be done by making up for the slowness of the software by the high speed of computer hardware, but it must be controlled. Remember, it must be controlled.

First, let's take a look at what kind of hardware we use. The most important thing in hardware is the CPU. I remember reading a book before. The author mentioned using a CPU in the weak 8086 era to scan the keyboard, just a few MHz. He tested it. People clicked the keyboard at the crazy speed, and the CPU scanned the keyboard 36 times during the two clicks. The CPU used by everyone is quite good. Most of them are over 1G Hz. What is the concept of 1G Hz? That is, it can execute hundreds of millions of machine commands in one second, one line of C #CodeI will not compile and generate more than 1000 machine commands. In one second, millions of lines of C # code have been executed. What's more, what kind of super pipeline, pre-jump and other acceleration means are used by modern CPUs. The CPU is faster, the memory is faster, the hard disk is faster, and it will be faster in the future.

Let's take a look at the program we want to write. The program we discuss here is a general application information management system running on a PC. A feature of such a program is that it does not need to be real-time or has low requirements. It allows a certain amount of time to wait for the operation to be processed. Because the computer is getting faster and faster, but the human response speed remains the same. For 100 milliseconds, the computer executes tens of millions of commands during this time period, while humans move the mouse and press the button, several 100 milliseconds have passed, not to mention the slow thinking of human operations. Therefore, the meaning of 100 milliseconds is different for computers and people. We should use this difference to help us develop software.

For example, it takes 100 ms to run a software function, and it takes January years to complete development. Now it is 10 times more complex, and we need to complete it in October. However, the lack of computer hardware speed is 100 times faster, and the software operation time is 10 milliseconds. For operators, there is no difference between 100 ms and 10 ms, but for developers, there is a huge difference between January and 10 months. At this time, if there is a means to greatly reduce the development time, such as two months, but the software speed is 100 times slower, the time consumed for running the software remains unchanged. This change is imperceptible to operators, but it is a good news for developers.

Therefore, as software developers, we can determine a principle that we should pay more attention to the software development speed without seriously reducing the software performance, we should use the software running speed in exchange for the software development speed.

Finally, let's take a look at how we develop programs. Based on the current level, the software cannot be automatically generated either now or for a long time. We also need to develop software manually, we need to use natural and human thinking capabilities to design programs and write programs. All development tools only help us to remember the current state of work and reduce low-level development work. At this time, computer software cannot fundamentally help us develop software. Human Thinking Ability has its own development speed limit, far below the development speed of computer hardware. If there is no change in the development strategy, the software will be 10 times more complex, and we will spend 10 times the development time, even if there are various auxiliary tools, this time will not be reduced much.

Our software is getting more and more complex, and our programmers are getting more and more worried. How can we develop constantly expanding and complex software? Therefore, we have proposed many methods.

The first is code reuse. At the beginning, we didn't reuse code. All functions were implemented in one program. Then, the operating system database and other system software emerged, integrating some underlying operations into the operating system, API functions are provided for calling, and more software provides API functions, followed by COM objects, but now it is a Java package or.. Net assembly. These changes lead to slower programs, lower interface efficiency, and more bloated frameworks.

Then there is a change in computer language. From assembly to C language, C ++, VB, and then Java and C #, that does not lead to software bloated and low efficiency.

For all of these, we seem to be regressing and degrading. So we started to break the jar.

I used to write a program, so I don't have to waste a single bit of memory, but I don't have a lot of instructions. Now I have some big tricks.

Previously we constructed a sophisticated data structure, and now we have closed our eyes for enumeration.

Previously, we only called fast and direct interfaces, such as interruptions and API functions. Now we advocate slow and inefficient WebServices.

Are we actually falling down? Are we really getting lazy? No, we get busier and more thoughtful. We know that low-level operations should not be considered in most cases. In this era of growing software scale, it is unwise for us to focus too much on underlying operations, it is not time-consuming. We should focus more on applications and business logic. However, underlying operations have to be considered. Fortunately, the collective wisdom of humans is very powerful. There are many frameworks that can help us hide underlying operations, such as various COM libraries ,.. NET Framework, Java framework, and various ORM frameworks. All the frameworks make our programs bloated, but I strongly recommend them, because these frameworks can greatly accelerate our development speed and the current hardware can make bloated programs run like a fly.

Many of our programmers are pursuing perfection. In the context of the current age, they are still pursuing software operation efficiency too much. For example, C ++ is required to call WIN32API, because it is fast and efficient. The so-called Original Ecological call is called in other languages. However, C ++ is difficult to develop applications, such as ASP. net, few use C ++, but use VB. net or C # developed ASP.. Net program calls WIN32API and runs happily.

Here we will talk about the significance of technology. My point is that technology is also the unity of opposites. In the process of implementation, we should pursue perfection like art, but its ultimate goal is very realistic, it is to save time and effort for developers or technical users. Developing software is a technical activity. You must consider the balance between the two points. Imperfect or too perfect technologies will not save time and effort. Generally, the more perfect the technology is, the slower the development speed, but the faster the operation speed is. This is like a parabolic phenomenon. We should pursue its highest point. Here we get the most, this requires a balance between development speed and running speed.

Here I mention a special case in the functional modules of common programs, that is, the graphical user interface. For graphical user interface programs, the running speed must be considered, because the user interface is for people to see, the response speed of human eyes is very fast and sensitive, which is much faster than the brain's thinking speed and hands-on operation speed. Therefore, we must consider drawing the running speed of user interface program modules, it must be fast; otherwise, the screen will flash, seriously affecting the user experience.

Finally, let's talk about the strategy to deal with complicated technical difficulties. In most cases, solving multiple simple problems is much more complicated than solving a single complex problem, with a long time and low efficiency, however, this process can be controlled. This is the right path. Some mathematicians prove that complex propositions do this. Of course we can.

Therefore, for complex programming problems, we can consider splitting it into multiple simple problems to solve. This has many advantages. First, the process can be controlled. For a single complex problem, it is difficult for us to solve the problem. Sometimes we have to rely on inspiration to develop an application system. It is unreliable to rely too much on inspiration and there is a great risk. However, for simple problems, we can determine the time needed based on past experience, which allows the software development process to be estimated and controlled. The second is to split the problem to solve group cooperation. One person can only solve one problem. If a problem is encountered, the project team can only count on the person who solves the problem. However, after the problem is split, all members of the project team can participate in solving this problem, which gives full play to the advantages of group cooperation. Although sometimes it is worthwhile to solve the problem and reduce the running efficiency.

In short, the development speed and running speed are a natural contradiction and need to be balanced and reconciled. However, in the current environment, we should focus more on the development speed, but everything has a degree. We should not only consider the development speed, but not the running speed, otherwise, the balance will collapse, which is not good for anyone.

Note: The software mentioned in this article is limited to common information management software, including desktop and web programs. It runs on PCs without real-time requirements. This article is not reliable for other software such as real-time systems, embedded systems, and system software.

Yuan Yongfu (http://www.xdesigner.cn) 2006-11-3

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.