Summary of the invention
For addressing the above problem, the object of the present invention is to provide a kind of method that can obviously accelerate the toggle speed of firefox, in view of the slow main cause of current firefox toggle speed is to have a large amount of I/O read-write operations in the firefox start-up course, and the existing mode of revising configuration file that adopts on the windows platform improves the technology of firefox toggle speed, can not reach obvious effects, so the invention is intended to adopt mode and the combination of other optimization method of revising configuration file to improve the firefox toggle speed effectively.
It is on the linux platform that firefox of the present invention starts accelerated method, start cache file and will start required file from the compile optimization of firefox, configuration optimization, preservation and move internal memory and realize that from internal memory these four aspects of startup firefox are optimized the start-up course of firefox, so that significantly reduce the I/O read-write operation in the firefox start-up course, thereby improve the firefox toggle speed effectively.
The method that firefox of the present invention starts the optimization firefox toggle speed of accelerated method employing mainly is the required file of startup to be moved internal memory realize starting firefox from internal memory;
It may further comprise the steps:
(1) optimizes compile option.When compiling firefox source code bag, it is carried out customization optimization, promptly remove the unwanted funtion part of current system,, can reduce the unnecessary I/O read-write operation in the firefox start-up course like this as label assembly, download management, language extension etc.; Keep and the required funtion part of optimization system, promptly by adding the compiling configuration file of firefox, and the mode that adds essential compile optimization option (as plug-in unit, library file, optimization rank etc.) realizes.
(2) optimize the startup configuration.Demand according to different system or research and development of products, some function of firefox can be integrated when compiling, but when starting, there is no need fully to load,, only keep the also wherein essential function of optimization so the function that does not need to load and be provided with firefox can be started the time all prohibits to fall.Specifically can check the default setting of default browser and renewal from cancellation firefox, forbid reservation and the visit of firefox to historical record, optimize the firefox database and enable expansion, the useless clauses and subclauses that deletion firefox user preference (User Perference) is provided with in the file realize with the aspects of giving tacit consent in the expansion such as ket language bag.
(3) preserve the startup cache file, promptly preserve firefox and start the cache file that the back generates.It is file except that system file that the firefox that the present invention mentions starts required file, like this, firefox starts required file and comprises cache file and the alternative document except that cache file, cache file does not need to load in the firefox start-up course, be the file of using in the firefox operational process, the alternative document except that cache file all needs to load in the firefox start-up course.Start in the flow process at the firefox of acquiescence, firefox can scan and visit system according to the configuration information of self when starting, and can generate some cache files after this process finishes, and these files have just disappeared after system closing.Custom-built system or complete linux system (as PC) for based on firefox can preserve these cache files.Like this, after when firefox starts, detecting this cache file and existing, only need not have in scanning and the access cache file, the required file of startup, significantly reduced I/O read-write operation in the firefox start-up course.
(4) will start required file and move internal memory realization from internal memory, startup firefox.In traditional Starting mode, all be to carry out earlier the firefox executable program, then executable program scan again, reading writing harddisk, with the load content in the hard disk to internal memory so that start.The present invention starts required file with firefox and moved internal memory before starting the firefox start-up routine, thereby realizes starting from internal memory firefox.
Need to prove that above-mentioned firefox starts the in close relations of four steps optimizing, compile optimization and configuration optimization are to preserve firefox to start cache file and start required file and move internal memory realizes starting firefox from internal memory basis; Preservation firefox startup cache file and the required file of startup are moved internal memory and are realized that from internal storage starting firefox be the committed step that the realization startup is optimized, and influence very big to the firefox toggle speed.To effectively improve firefox toggle speed under the linux system, need closely cooperating of these four steps.
By above-mentioned steps, firefox of the present invention starts the toggle speed that accelerated method can obviously be accelerated firefox, and can in the firefox compile optimization, adopt the mode of Intel icc compiler and optimization compile option to do optimization process from the runnability of program, with the runnability of further raising firefox.
Embodiment
In order to make the technology used in the present invention, means and advantage thereof, lift now that preferred embodiment and conjunction with figs. describe in detail as after, this only for the usefulness of explanation, is not subjected to the restriction of this kind structure in patented claim.
Firefox startup accelerated method of the present invention is the compile optimization from firefox, configuration optimization, preserve firefox and start cache file, move internal memory and realize from internal memory, starting that these four aspects of firefox are optimized the start-up course of firefox starting required file, thereby improved the firefox toggle speed greatly, wherein, technological invention point of the present invention mainly is: preserve to start cache file and will start that required file is moved internal memory earlier and from internal storage starting firefox, but quick startup with regard to firefox, for reaching optimum efficiency, compile optimization and the configuration optimization part that also is absolutely necessary.
Be example with the firefox-3.5.4 version below, in conjunction with the accompanying drawings 2, firefox of the present invention starts the realization flow figure of speed technology first, further specifies firefox of the present invention and starts that firefox starts the realization flow figure that optimizes in the accelerated method.
(1) specific embodiment of firefox startup accelerated method of the present invention at first carries out compile optimization.
Wherein the startup of firefox is quickened, and from the angle of compiling, its purpose mainly is to realize 2 points:
(1) reduces unnecessary startup of firefox and operation item;
(2) runnability of optimization firefox comprises actuating section;
It realizes that the technological means that adopts is: optimize the firefox compile option, select appropriate parameters optimization and use the Intel compiler.
1. optimize the firefox compile option
Dispose function and the unwanted function of firefox that firefox will have by writing " .mozconfig " file, reduce firefox unnecessary expense in time in start-up course like this.
2. select appropriate parameters optimization
The compile optimization of firefox and other application programs all has a parameters optimization, uses the mode of " 03 " to optimize in this document, and adds the optimization instruction at particular platform.
3. use the Intel compiler, concrete this paper uses Intel Atom compiler to optimize compiling firefox, and the performance of firefox can promote much like this, because present technique is done main realization on development platform Atom.But be not to be the Atom platform like this, use the Intel compiler just can not improve the performance of firefox.
Its specific implementation step can be: download required firefox source code bag (step 10), as firefox-3.5.4-source.tar.bz2, compile optimization (step 11) will be carried out behind its decompress(ion), remove the unwanted firefox funtion part of current system, as label assembly, download management, language extension etc.; Keep and the required firefox funtion part of optimization system, promptly add the compiling configuration file of firefox, and add essential compile optimization option, as plug-in unit, library file, optimization rank etc.Because it is a large amount of I/O read-writes that firefox starts slow main cause, be embodied in the firefox initialization, scanning loads and write in these three steps of buffer memory.(step 11) is just from having reduced the startup I/O read-write operation of firefox in essence by compile optimization.If not so, load and write in firefox initialization, scanning and have a large amount of I/O read-write operations in the process of caching, influence the firefox toggle speed.
(2) the firefox source code bag behind the compile optimization, (step 12) is as firefox-3.5.4.en-US.linux-i686.tar.bz2 (this tarball can move behind the decompress(ion) in the system of any support firefox) to generate the target binary executable.Copy this binary executable to will carry out catalogue and carry out decompress(ion), the firefox script behind the decompress(ion) can start compiled firefox just.
(3) (step 13) is promptly by revising the user class setting that configuration file realizes that firefox starts to be needed to be configured optimization before firefox starts.This step has certain influence to the firefox toggle speed, but is not very obvious.If yet mis-arrange also can load and write a large amount of I/O read-write operations of generation in the process of caching in initialization, scanning, brings very big burden for the firefox start-up course, influences the firefox toggle speed.Configuration optimization (the step 13) specific implementation comprises:
Cancellation firefox checks whether it is the function of default browser.Because at present the runnability of firefox is very considerable, the version after the 3.5.0 version particularly is so can directly be set to firefox the browser given tacit consent to.Certainly, also any default browser can be set, just cancel firefox and check whether it is the function of default browser, thereby reduce firefox because check whether it is the start-up time that default browser consumes.
Cancellation firefox checks the function of upgrading.According to the setting of firefox configuration file, firefox can check when starting whether firefox has new version to upgrade under default configuration, can take very long start-up time, particularly network speed like this and is not under the very fast situation.For the system that firefox has been installed,, can in the firefox operational process, it manually be upgraded by the user as PC etc.; For the Related product that relates to firefox,, can upgrade upgrading to it by the developer as based on set-top box of firefox etc.
Cancellation firefox attacks the function that website detects, and forbids preserving the attack station data.Attack website and detect and preserve the toggle speed that data all can influence firefox.If of course, be set to respectively cancel and forbid, can't influence the runnability of firefox like this, and detect if desired and attack website, also can from menu, carry out manually.But,,, then can keep measuring ability as online transaction if relate to the operation higher to security requirement.
When withdrawing from, clears up firefox its downloads historical data of preserving in service automatically.When firefox withdraws from, just the historical data of preserving in this operational process is removed, when start next time, just can not caused toggle speed slack-off like this because of reading the historical data of leaving in operational process last time.
Forbid firefox default access historical record, only use add-on assemble Tab MixPlus (homepage) expansion of firefox to carry the historical record function.Tab Mix Plus is used to improve the tag performance of firefox, function such as closes as many labels, control label focus, label click option, label.
Optimize the firefox database.Database among the firefox can become increasing because of the increase of its service time, the time of the data consumes in the firefox reading database is more and more longer, thereby the operational efficiency that causes firefox worse and worse.Therefore, by optimizing database, can reduce the start-up time that firefox consumes because of the data in the reading database.
Optimize firefox and enable expansion.In general, the firefox expansion is many more, can influence its toggle speed more.Can prohibit to fall for the expansion that firefox does not use, improve its toggle speed.
Optimize firefox user preference (User Perference) file is set.User preference (UserPerference) is provided with the various clauses and subclauses that are provided with that file has been preserved firefox, can with use less than some clauses and subclauses deletions is set, improve the firefox toggle speed.
Ket language bag in the deletion firefox expansion.The firefox of acquiescence supports multilingual, and they can increase the I/O time for reading because of loading character library when firefox starts, and can will wherein use less than the choice of language deletion, thereby reduce the I/O time for reading, improves the firefox toggle speed.
(4) (after step 13) finishes, start firefox program after optimizing (step 14), and preserve firefox and start cache file (step 15) at configuration optimization.Existing present embodiment is example with the set-top-box system, as being example with the linux union file system based on the fedora12 cutting, illustrate and how to preserve firefox startup cache file (step 15), its specific implementation step is as follows:
(1) preserves the startup cache file
The cache file that firefox starts is preserved for starting acceleration first, is operated as follows:
#cp/opt/firefox/root/-a # prepares packaging file
#cd/ # switches under the root directory
#tar?zcvf?firefox_starting_files.tgz/root/.mozilla/root/firefox
# preserves cache file and the following step will be realized the required file of internal storage starting
Through aforesaid operations, just firefox is started cache file and preserved, and also be that the 2nd step is got ready.
(2) will start required file and move internal memory earlier
Before starting firefox, the document copying that first step is made is operated as follows to internal memory:
#cd/# switch operating catalogue is to root directory
#tar zxvf firefox_starting_files.tgz-C/root/ # starts required file with firefox and moves internal memory
#ln-sf/root/firefox/firefox/firefox/usr/bin/firefox # is from internal storage starting firefox
So far, above-mentioned two steps finish.
This step also can realize with following operation fully in fact:
#cp/root/.mozilla/tmp
#rm-rf/.root/.mozilla
#mv/tmp/.mozilla/.root/# copy .mozilla is under/.root/
In the 2nd step, just only need move then ,/opt/firefox is to internal memory, operates as follows:
#cp/opt/firefox/root/-a
Certainly, except above-mentioned method of operating, can use other implementation method.Such as: preserving this step of cache file, general/root/.mozilla copies any position of preserving to, before the 2nd step startup firefox it is being copied to down then/root/ under; Then, in the 2nd step copy/opt/firefox arrive/the root/ catalogue under.
Wherein, ((step 13) can influence the size of these cache files to compile optimization, if compile optimization and configuration optimization are proper, this cache file is less, otherwise bigger for step 11) and configuration optimization.The size of this document also can have influence on the toggle speed first of firefox.
(5) firefox is started required file and move internal memory (step 16), realization starts firefox from internal memory, here the required file of the startup of mentioning comprises cache file and the alternative document except that cache file, cache file does not need to load in the firefox start-up course, be the file that may use in the firefox operational process, the alternative document except that cache file all needs to load in the firefox start-up course.Starting firefox from internal memory is that the firefox acquiescence is started initialization in the flow process, scanning loads and writes a large amount of I/O read-write operations that these three steps of buffer memory cause and is converted into firefox and starts required file and move a small amount of I/O read-write operation that internal memory (step 16) process is brought, and significantly reduces firefox and starts the time that consumes in the flow process on the I/O read-write operation.In addition, ((step 13) is improper for step 11) and configuration optimization as if compile optimization, firefox starts required file can be very big, moves and also can produce bigger I/O read operation in the process of internal memory (step 16) will starting required file like this, can influence the firefox toggle speed equally.
This shows, compile optimization (step 11), configuration optimization (step 13), preserve start cache file (step 15) and will start required file and move the in close relations of these four steps of internal memory (step 16), ((step 13) is to preserve startup cache file (step 15) and will start the basis that required file is moved internal memory (step 16) to compile optimization for step 11) and configuration optimization; Preserve to start cache file (step 15) and will start required file to move internal memory (step 16) be to realize that firefox starts the committed step of optimizing, and influences very big to the firefox toggle speed.So, realize the optimization of firefox toggle speed under the linux system needing closely cooperating of these four steps.Certainly, with any one or several the removing in above-mentioned four steps, can realize that also the startup of firefox is quickened, but not be optimum startup speeding scheme that promptly the toggle speed of firefox also can improve, but does not reach optimal degree.Such as, the preservation startup cache file that removes among Fig. 2 (after the step 15), also can improve the firefox toggle speed.But because most I/O read-write operation all occurs in scanning this step of loading in the firefox start-up course, if do not preserve cache file, the scanning in the firefox start-up course loads file access meetings a large amount of in this step and brings a large amount of I/O read-writes; If preserve cache file, because required a part of file detects in cache file in the firefox start-up course, with regard to not needing it is scanned and visits, the file access amount that scanning in the firefox start-up course loads in this step significantly reduces, I/O read-write operation in the firefox start-up course also just significantly reduces, and the firefox toggle speed obviously improves.After tested, under the environment that is configured to Intel (R) Core (TM) CPU N2701.60GHz double-core Atom platform, linux set-top-box system, if the preservation that keeps among Fig. 2 starts cache file (step 15), firefox is about 15s start-up time, if the preservation of removing among Fig. 2 starts cache file (step 15), firefox is about 10s start-up time, differs about 5s both start-up times.
Need to prove, except process flow diagram shown in Figure 2, also can adjust the sequencing of performing step wherein and do not influence the realization effect of its optimum.Such as, can (the firefox program after step 13) places and start to optimize be (after the step 14) and will start required file and move internal memory (step 16) and carry out before with configuration optimization.
Existing firefox starts process flow diagram as shown in Figure 1 under the linux system, and after the operation firefox program, firefox begins to carry out a series of initial work, comprises that memory-mapped, required Runtime Library read, file access etc.Then scanning loads, comprise read configuration file, load fontlib, scanning charging assembly, scanning loading of plug-in, scanning load expansion etc.Write buffer memory at last, with system start-up and move required cache file and write in the hard disk, and read and the synchro system time.Arrive this, the start-up course of firefox just is through with.
After the flow process that adopts Fig. 2 was optimized firefox, firefox started flow process as shown in Figure 3, may further comprise the steps:
(1) to carry out before and will start required file and move internal memory (step 20) starting firefox program (step 21), otherwise, I/O read-write startup desired data on the meeting degaussing dish is compared with moving in internal memory fully like this in the firefox start-up course, and consume bigger the start-up time of firefox.
(2) start firefox program (step 21).That will guarantee to start when starting firefox program (step 21) is the firefox that optimized.For complete platforms such as x86, the user can directly install after having compiled firefox, can the preceding firefox of coverage optimization after the installation.For embedded or customization platform, the firefox after the developer need optimize according to different system environments employing diverse ways installations perhaps can adopt the mode of link directly to specify the firefox that starts after optimizing.
Need to prove that under the linux system, will start required file and move internal memory (step 20) and also can start firefox program (step 21) afterwards, initialization (step 22) is carried out before.
(3) initialization (step 22).Initial work comprises mainly that memory-mapped, required Runtime Library read, file access etc.Because the executable file difference that generates before and after firefox optimizes, so the firefox initial work after optimizing has tangible minimizing on workload, promptly read the number of times of Runtime Library and the quantity of documents of visit and significantly reduce, corresponding I/O read-write operation has also just reduced.
(4) read the cache file (step 231) preserved in the internal memory and load and start required alternative document (step 232) from internal memory, these two steps have replaced the scanning among Fig. 1 to load.
Moved internal memory (step 20) owing to start required file among Fig. 3, cache file has read (step 231) in internal memory, start required alternative document and from internal memory, loaded (step 232), so just do not need the buffer memory of writing among Fig. 1, be about to firefox startup and the required file of operational process and write the such process of disk from internal memory.
Test firefox-3.5.4 version on the set-top-box system that upper layer application realizes based on firefox, be 17s the start-up time first before firefox does not optimize, be 10s the start-up time first after the optimization, reduces 7s.At the interior 2.0G that saves as, processor is 3.5.4,3.5.9 and the 3.6.3 version of test firefox on the notebook computer of Inter (R) Core (TM) 2Duo CPU T65002.10GHz, be not about 6s first start-up time before optimizing, be about 4s the start-up time first after the optimization, reduce about 2s start-up time.
The present invention only describes with the example that is embodied as that the firefox of 3.5.4 version starts speed technology first, in fact the present invention is applicable to that any custom-built system or holonomic system (as PC) go up the startup acceleration of any version firefox, wherein, most typical application scenarios is the set-top-box system that upper layer application realizes based on firefox.