Home > Back-end >  How to improve the software run faster?
How to improve the software run faster?

Time:09-27

Excuse me each ace:
I developed a program written in every operation step to hard disk, hundreds of data read, write, will it take long to complete,

See others software development speed, speaking, reading and writing data to flash, and only at the time of exit prompted save, the method of how to implement?

CodePudding user response:

Is too general, only actual test to find the bottleneck of application, and optimize the code to the utmost,

If the problem on hard drives, might as well write cache first, then find the free space to write program; In the thread writing hard disk;
What is written by other mechanisms, is build big empty file written in advance, establishment and write a new file, or each time these will cause a lot of different

CodePudding user response:

This problem, the problem is the program must face, should be an important factor for the completion of the code,

A, the program involves the speed
1, starting speed, initialization, connect to the Internet to read data, program updates...
2, open up new form (page) speed, initial parameters read
3, the running speed, the local hard disk read and write data, remote network data read and write ()
4, the speed of the program exits, save the local Settings, update the data in the remote,

Second, to form a good habit
1, the local INI file to read speed is slow, use less as far as possible;
2, the data is read, in does not affect the accuracy of (synchronous), if use the cache,
3, large amount of data read, using a thread;
4, data reading and writing time is more than 1 second, according to schedule, relieve the user of waiting,
5, in the code, should be deliberately reduce the number of reading and writing, speaking, reading and writing,

Three, take the necessary technical means (slightly vary from person to person)

CodePudding user response:

Threads can handle many more complex process, also can improve the speed of software, of course also want to reasonable use,
Code optimization is also indispensable;
Application process, function of the related algorithms are to be considered, a good algorithm is quite important,

CodePudding user response:

Join the cache mechanism

CodePudding user response:

Hug the main use of database, change the custom file structure, cooperate with FileMapping and memory cache is a second operation

CodePudding user response:

Application cache, to a certain extent, such as 5 minutes at a time, so that access to too much, at the same time if there is a crash or easy to recover,

CodePudding user response:

Through the thread time saving data, is also a good way,

CodePudding user response:

Every operation step to hard disk write
The written into a memory array or stringlist, every time or accumulated much line, practical writing plate only once

CodePudding user response:

LZ is directly read data in the file, and then, when the modified data to write back, because the file only order to read and write, so we have to rewrite the entire data file, resulting in slow? If so, why not consider to use the database?
  • Related