CN101013368A - Performance optimal design method for graph library of embedded system development platform - Google Patents
Performance optimal design method for graph library of embedded system development platform Download PDFInfo
- Publication number
- CN101013368A CN101013368A CN 200710067160 CN200710067160A CN101013368A CN 101013368 A CN101013368 A CN 101013368A CN 200710067160 CN200710067160 CN 200710067160 CN 200710067160 A CN200710067160 A CN 200710067160A CN 101013368 A CN101013368 A CN 101013368A
- Authority
- CN
- China
- Prior art keywords
- memory
- library
- link
- qtopia
- embedded system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention involves embedded system, aiming to provide a graphics performance optimization method for an embedded system development platform. The method includes the following steps: (a) reload the allocation / release memory operations; (2) Pre-link Qtopia shared library: link the executable file to the shared library in advance, and copy the files on the PC platform and the related part of Qtopia to the embedded platform as standard files when path look up. Then, use commands to pre-link target file; (3) reduce the size of the executable file. The invention improves the performance of memory allocation and release by eliminating the two common functions. It updates the dynamic library and reduces the time spent on re-location in dynamic link when run the program by pre-link all the shared libraries, while the expansibility of the program is not weaken. Furthermore, special instructions are used to reduce the size of executable files and improve efficiency.
Description
Technical field
The present invention relates to embedded system, in particular, relate to a kind of performance optimization method for designing of graph library of embedded system development platform.
Background technology
Qtopia be by Trolltech company based on Qt/Embedded exploitation ground first Windows and application program embeddedly, two kinds of different versions of PDA and PHONE are arranged.It is widely used in PDA, mobile phone, the network facilities, hand-held device etc.It comprises a complete set of personal information management PIM (Personal InformationManagement), as address book, computer, schedule, MPEG broadcast, image demonstration, browser etc., also also has Email, recreation, configuration tool certainly.
Current, the performance of QT on PC is extraordinary.Qvfb has been arranged, and the Qtopia program also can be moved on Intel XScale PXA 255.On PC, the start-up time of whole Qt/Qtopia taskbar, wherein starting for the first time was 0.8 second less than 1 second, and starting for the second time is 0.4 second.For the second time the time be smaller than be for the first time because the part file destination Already in internal memory suffered.
But the achievement of Qtopia on Intel XScale PXA 255 is not so good just.On the plank of this experiment, whole Qtopia startup has approximately been spent 28 seconds.Qtopia is meant that Application::exec calls the time before taking place start-up time.This is owing to Qt/Embedded realizes with C++, thus in the GUI of several maturations the system resources consumption maximum.So be necessary it is optimized.
Improve Qtopia graph function storehouse, promote the performance of focus function, increase buffer memory, can be optimized Qtopia, still, use these optimization, substantially all the bottom function of Qtopia is not carried out any modification, only be to use external tool, perhaps change the drafting method of Qtopia, do not give full play to the customizability of Qtopia like this, increased the restriction of these optimization methods yet.
Summary of the invention
In order to overcome deficiency of the prior art, the invention provides a kind of performance optimization method for designing of graph library of embedded system development platform.
For the technical solution problem, the present invention is achieved through the following technical solutions.
A kind of performance optimization method for designing of graph library of embedded system development platform may further comprise the steps:
(1) heavy duty of storage allocation and releasing memory:
1. the heavy duty of storage allocation: when heavy duty, the behavior that function provides is consistent with the storage allocation operation of system default, and correct rreturn value be arranged; To call the error handling processing function when free memory is not enough; Handle the situation of 0 byte of memory request well;
2. the heavy duty of releasing memory: what occur requiring release is the situation situation of address blank, does not do any operation, directly NULL is returned.
(2) link the Qtopia shared library in advance: for executable file links shared library in advance, to copy on the embedded platform after file on the PC platform and the reservation of Qtopia relevant portion, as standard lookup path file, adopt the order of file destination to link in advance afterwards;
(3) reduce the executable file scale: reduce the executable file scale, accelerate the speed that the Qtopia shape library starts, the method for utility command line command file destination realizes.
As a kind of improvement, described rreturn value comprises: if the pointer that points to internal memory is just returned in Memory Allocation request success; If failure, the type of then dishing out is unusual.
As a kind of improvement, described heavily loaded storage allocation operation may further comprise the steps:
(1) initialization operation: define a new pointer, be used for doing the pointer of opening up after the internal memory;
Set up the variable of a variable and storage allocation correspondence, the value of judgment variable: if this value is 0, it is 1 that this value is set so, prevents to distribute address blank, if not, directly enter the next stage;
(2) open up internal memory: with alloc function storage allocation, use a pointed it;
(3) judge unusually: get nowhere if distribute, report is unusual, and the storage allocation function of calling system if be allocated successfully, returns the pointer of previous step foundation.
As a kind of improvement, described heavily loaded releasing memory operation is to use the heavily loaded releasing memory operation of function, if the pointer of releasing memory is not empty, uses function, if be empty, returns sky.
Compared with prior art, the invention has the beneficial effects as follows:
At first, the efficient height, by removing the versatility of two functions, the performance when having improved distribution and releasing memory space; Secondly, upgraded dynamic link library, linked all shared libraries, can under the prerequisite that does not weaken the program extendability, spend the dynamic link time in reorientation when reducing program start significantly like this with the pre-method that links; At last, use special-purpose order, reduce the execution scale of executable file, raise the efficiency.
Description of drawings
Fig. 1 is the process flow diagram of heavily loaded new function.
Fig. 2 is the process flow diagram of heavily loaded delete function.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail by specific embodiment.
A kind of performance optimization method for designing of graph library of embedded system development platform may further comprise the steps:
(1) heavy duty of storage allocation (new) and releasing memory (delete):
For heavily loaded new/delete operation, the present invention revised/ partial code in qt-2.3.9/src/qobject.cpp, qobject.h and four files of qsignal.cpp, qsignal.h.For the heavily loaded new/delete operation of energy can be that all Qtopia functions use, the present invention has selected heavily loaded new/delete operation in qobject.h and qobiect.cpp.The QObject class is the base class of all Qt objects, and it is inherited by most Qt storehouse class, and the basic functions of some Qt such as timer, Object Management group etc. are provided.And also can be inherited by subclass as the new/delete operation of the member function of QObject, can shield former new/delete operation simultaneously as overall situation statement.
1. heavily loaded new operation:
The function declaration of at first, need be in qobject.h and qsignal.h heavily loaded new operation is:
void*operator?new(size_tsize);
When heavy duty, the very important point is that the behavior that provides of function is consistent with the new operation of system default, just: correct rreturn value be arranged; To call the error handling processing function when free memory is not enough; Handle the situation of 0 byte of memory request well.
The part of relevant rreturn value is very simple.If the pointer that points to internal memory is just returned in Memory Allocation request success; If failure, the std::bad_alloc type of then dishing out unusual.But thing neither be so simple.Because in fact new operation can attempt going storage allocation more than once, it will call the error handling processing function after each failure, expects that also the error handling processing function can try every possible means to discharge the internal memory in other places, and this will be a round-robin process.This circulation only can be jumped out two kinds of situations: one, under the situation of the pointer that points to the error handling processing function for sky, circulation is also jumped out in calling system new operation; Two, Memory Allocation success and jump out circulation.
New operation acquiescence has six kinds of heavily loaded forms, and is as shown in the table.
Distribute the monolithic internal memory | Distribute the polylith contiguous memory |
void*operator?new(std::size_t?count) | void*operator?new[](std::size_t?count) |
void*operator?new(std::size_t?count, const?std::nothrow_t&) | void*operator?new[](std::size_t?count, const?std::nothrow_t&) |
void*operator?new(std::size_t?count, void*ptr) | void*operator?new[](std::size_t?count, void*ptr) |
The present invention only heavy duty distribute first kind of monolithic internal memory, reason: at first, it is one that is called maximum; Secondly, all the other 5 kinds of heavily loaded forms, comprise some other self-defining heavily loaded form all can itself function body intrinsic call it.So needed only correct heavy duty void*operator new (std::size_t count), in fact just finished other new and operated the heavy duty work of heavily loaded form.
According to above analysis, I just can provide concrete heavily loaded new operative algorithm such as accompanying drawing 1.
2. heavily loaded delete operation:
The function declaration of heavy duty delete operation is:
void?operator?delete(void*memoryToBeDeallocated);
Because new operation that the present invention has used malloc () heavy duty, so must come heavily loaded delete operation with free ().Use new, free or malloc with, delete can bring risk difficult to the appraisal.The delete operation is the same with the relation of new operational character with the new operation with the relation of delete3 operational character.Therefore can only heavy duty delete operation wherein.
With the new class of operation seemingly, delete also needs to consider if what require to discharge is the situation of address blank.Such situation occurring, can not do any operation, directly NULL is returned.
According to above analysis, the present invention just provides concrete heavily loaded delete operating process such as accompanying drawing 2.
(2) link the Qtopia shared library in advance:
In this experiment, use the compiler support to link in advance, so the prelink program that this paper has used compiler to carry.The present invention has linked shared library in advance for all executable files under distribution/lib and the distribution/bin catalogue.And because the bibliographic structure that PC and target Intel XScale PXA 255 adopts all is the Linux bibliographic structure of standard, so the position of the bright shared library of prelink.conf document does not change.So, can search the path file as standard prelink with copying on the PXA 255 in the prelink.conf file on the PC with after the reservation of Qt relevant portion.
The order line of pre-link shared library is: the prelink-s file destination.
(3) reduce the executable file scale:
In the present invention, compiler comprises the order that reduces the executable file scale, the arm-linux-strip program that can use compiler to carry is all carried out the arm-linux-strip order to executable files all under the distribution catalogue, just can reduce the scale of executable file.
The order line content is: the arm-linux-strip file destination.
For the effect of the new picture function checked, use the QTopia graph function storehouse of revising to experimentize.The target platform that we use is the development board of Intel XScale, and the operating system of use is ARMLinux.The data of this experiment gained all are to obtain on this platform.
Below be our platform detail parameters:
PC | Intel?XScale | |
Processor | Pentium?IV2.7 | ?XScale?PXA255 |
Compiler | gcc?3.2.2 | ?Arm-linux-gcc?3.3.2 |
Internal memory | 1G?DDR | ?64MB?SDRAM |
QTE | 2.3.9?free | ?2.3.9?free |
Qtopia | 2.1.1?free | ?2.1.1?free |
Be optimized at first respectively, data are tested in test.At last, integrate and do.According to performing step, we at first carry out the change of heavily loaded new/delete.We compile afterwards, adopt pre-chained technology in the time of link.At last, reduce the scale of executable file.
Be optimized respectively, 3 kinds optimized integration do then, obtain testing the contrast of final start-up time, we can see that the result is as follows:
Method | Start-up time (second) before optimizing | Optimize the back time (second) |
Heavy duty new/delete | 28 | ?21 |
Pre-link | 28 | ?24 |
Reduce the executable file scale | 28 | ?26 |
Comprehensively | 28 | ?16 |
We can see that start-up time, time performance significantly promoted by remarkable decline.
At last, it is also to be noted that what more than enumerate only is a specific embodiment of the present invention.Obviously, the invention is not restricted to above embodiment, many distortion can also be arranged.All distortion that those of ordinary skill in the art can directly derive or associate from content disclosed by the invention all should be thought protection scope of the present invention.
Claims (4)
1, a kind of performance optimization method for designing of graph library of embedded system development platform is characterized in that, may further comprise the steps:
(1) heavy duty of storage allocation and releasing memory:
1. the heavy duty of storage allocation: when heavy duty, the behavior that function provides is consistent with the storage allocation operation of system default, and correct rreturn value be arranged; To call the error handling processing function when free memory is not enough; Handle the situation of 0 byte of memory request well;
2. the heavy duty of releasing memory: what occur requiring release is the situation situation of address blank, does not do any operation, directly NULL is returned;
(2) link the Qtopia shared library in advance: for executable file links shared library in advance, to copy on the embedded platform after file on the PC platform and the reservation of Qtopia relevant portion, as standard lookup path file, adopt the order of file destination to link in advance afterwards;
(3) reduce the executable file scale: reduce the executable file scale, accelerate the speed that the Qtopia shape library starts, the method for utility command line command file destination realizes.
2, the performance optimization method for designing of a kind of graph library of embedded system development platform according to claim 1 is characterized in that, described rreturn value comprises: if the pointer that points to internal memory is just returned in Memory Allocation request success; If failure, the type of then dishing out is unusual.
3, the performance optimization method for designing of a kind of graph library of embedded system development platform according to claim 1 is characterized in that, described heavily loaded storage allocation operation may further comprise the steps:
(1) initialization operation: define a new pointer, be used for doing the pointer of opening up after the internal memory;
Set up the variable of a variable and storage allocation correspondence, the value of judgment variable: if this value is 0, it is 1 that this value is set so, prevents to distribute address blank, if not, directly enter the next stage;
(2) open up internal memory: with alloc function storage allocation, use a pointed it;
(3) judge unusually: get nowhere if distribute, report is unusual, and the storage allocation function of calling system if be allocated successfully, returns the pointer of previous step foundation.
4, the performance optimization method for designing of a kind of graph library of embedded system development platform according to claim 1, it is characterized in that, described heavily loaded releasing memory operation is to use the heavily loaded releasing memory operation of function, if the pointer of releasing memory is not empty, use function, if be empty, return sky.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100671608A CN100492286C (en) | 2007-02-02 | 2007-02-02 | Performance optimization design method for graph library of embedded system development platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100671608A CN100492286C (en) | 2007-02-02 | 2007-02-02 | Performance optimization design method for graph library of embedded system development platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101013368A true CN101013368A (en) | 2007-08-08 |
CN100492286C CN100492286C (en) | 2009-05-27 |
Family
ID=38700904
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007100671608A Expired - Fee Related CN100492286C (en) | 2007-02-02 | 2007-02-02 | Performance optimization design method for graph library of embedded system development platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100492286C (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102385509A (en) * | 2010-08-31 | 2012-03-21 | 苏州大学 | Graphical embedded type development method and platform |
CN102760218A (en) * | 2011-12-16 | 2012-10-31 | 哈尔滨安天科技股份有限公司 | Virus characteristic library sharing method and device based on dynamic link library |
CN101702130B (en) * | 2009-11-12 | 2012-12-26 | 深圳市五巨科技有限公司 | Method for loading sharing function library with movable terminal and device thereof |
CN109857640A (en) * | 2018-12-28 | 2019-06-07 | 上海航天控制技术研究所 | A kind of embedded code based on prototype shifts to an earlier date verification method |
CN111427550A (en) * | 2019-01-10 | 2020-07-17 | 武汉瓯越网视有限公司 | Object creating method, terminal device and storage medium |
CN111506355A (en) * | 2019-01-14 | 2020-08-07 | 劳斯莱斯有限公司 | Optimization method |
CN111563253A (en) * | 2020-07-16 | 2020-08-21 | 百度在线网络技术(北京)有限公司 | Intelligent contract operation method, device, equipment and storage medium |
CN111565204A (en) * | 2020-07-16 | 2020-08-21 | 百度在线网络技术(北京)有限公司 | Block chain operation method, device, equipment and storage medium |
-
2007
- 2007-02-02 CN CNB2007100671608A patent/CN100492286C/en not_active Expired - Fee Related
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101702130B (en) * | 2009-11-12 | 2012-12-26 | 深圳市五巨科技有限公司 | Method for loading sharing function library with movable terminal and device thereof |
CN102385509A (en) * | 2010-08-31 | 2012-03-21 | 苏州大学 | Graphical embedded type development method and platform |
CN102760218A (en) * | 2011-12-16 | 2012-10-31 | 哈尔滨安天科技股份有限公司 | Virus characteristic library sharing method and device based on dynamic link library |
CN109857640A (en) * | 2018-12-28 | 2019-06-07 | 上海航天控制技术研究所 | A kind of embedded code based on prototype shifts to an earlier date verification method |
CN109857640B (en) * | 2018-12-28 | 2022-05-24 | 上海航天控制技术研究所 | Embedded code advanced verification method based on prototype design |
CN111427550A (en) * | 2019-01-10 | 2020-07-17 | 武汉瓯越网视有限公司 | Object creating method, terminal device and storage medium |
CN111506355A (en) * | 2019-01-14 | 2020-08-07 | 劳斯莱斯有限公司 | Optimization method |
CN111506355B (en) * | 2019-01-14 | 2023-11-17 | 劳斯莱斯有限公司 | Method for optimizing performance of reconfigurable power system |
CN111563253A (en) * | 2020-07-16 | 2020-08-21 | 百度在线网络技术(北京)有限公司 | Intelligent contract operation method, device, equipment and storage medium |
CN111565204A (en) * | 2020-07-16 | 2020-08-21 | 百度在线网络技术(北京)有限公司 | Block chain operation method, device, equipment and storage medium |
CN111565204B (en) * | 2020-07-16 | 2021-06-18 | 百度在线网络技术(北京)有限公司 | Block chain operation method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN100492286C (en) | 2009-05-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100492286C (en) | Performance optimization design method for graph library of embedded system development platform | |
EP2487585B1 (en) | Method and device for dynamically loading relocatable file | |
CN106156278B (en) | Database data reading and writing method and device | |
US6304867B1 (en) | System and method for enhanced performance of a relational database management system through the use of application-specific memory-resident data | |
US20110161945A1 (en) | Minimizing Register Spills by Using Register Moves | |
CN101187899B (en) | Embedded type system storage space optimization method | |
CN101668283A (en) | Method for dynamic loading in embedded system of mobile phone | |
US7856637B1 (en) | Runtime emulating static thread local storage of portable executable software code | |
CN100530108C (en) | Method and system for calling function | |
CN1813243B (en) | Apparatus and methods for desynchronizing object-oriented software applications in managed runtime environments | |
CN101763273B (en) | Method for dynamically loading code into extended memory of embedded type system | |
US7028293B2 (en) | Constant return optimization transforming indirect calls to data fetches | |
US8799629B2 (en) | Parallel execution of a loop | |
US20060070053A1 (en) | Dynamic linking of modules in a pre-operating system environment | |
CN108829465B (en) | Local dynamic loading system and method based on direct read-write FLASH | |
CN100533382C (en) | Program converting method | |
CN106201636A (en) | A kind of DSP off-chip code dynamic loading method and device | |
CN117193882A (en) | ELF loading method based on microkernel operating system | |
US6219825B1 (en) | Profile based optimization of shared libraries | |
CN105446789A (en) | Method and apparatus for building application in android system | |
Marinelli et al. | XJoin: Portable, parallel hash join across diverse XPU architectures with oneAPI | |
Dollinger et al. | Adaptive runtime selection for GPU | |
CN109240702A (en) | Quick segmentation addressing configuration and access method under a kind of multithread mode | |
CN110187884B (en) | Memory access instruction instrumentation optimization method in multi-thread application scene | |
CN102467452A (en) | Memory space allocation method of partial non-static data of static memory allocation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090527 Termination date: 20120202 |