Thoroughly optimized to stop Firefox from getting stuck

Source: Internet
Author: User
Tags sqlite manager
Article Title: thoroughly optimized so that Firefox is no longer stuck. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Firefox is the preferred browser for Linux users. You only need to check the comment of the LDCN visitor to know the popularity of the visitor.

Although Firefox is an excellent browser, there are still some shortcomings. For me, the biggest disadvantage is its performance. Simply put, it was very smooth at first, and it took a long time to get stuck.

Today, I thought about Firefox, analyzed the reasons for the Firefox card, and solved this problem by setting relevant parameters. Since then, the Internet has become more enjoyable!


-?

My Firefox user directory (~ /. Mozilla/firefox) is created from Ubuntu 7.10. It has been used for a dozen plug-ins, from Firefox 2 to Firefox 3, from Ubuntu 7.10 to Ubuntu 8.04.

In Firefox 2 of Ubuntu 7.10, the interface is often grayed out due to card issues.

Wait until Firefox 3 of Ubuntu 8.04 is better, but it is still stuck. Later, I compiled the code back to Firefox 3.0 with the ultimate compilation parameter. The situation is better, and the response in the address bar is a little faster. That's all. When Firefox is disabled, there will still be a long pause, and sometimes it will be stuck.

Although re-establishing the user directory will solve the problem (that is ~ /. Mozilla/firefox deleted), but a large number of documents/plug-ins have to come back, this cost is not enough, so you have to start from Firefox.

After reading the relevant information, I finally found that it was caused by "historical access" and "location.

This is not an access record of the "History" and "Address Bar" we can see, but a data layer.

Let's see if your data is too large.

Check the database size

Coming ~ /. Mozilla/firefox/***. default (varies by person). There is a places. sqlite file below to check its size. If it exceeds 10 MB, it will theoretically cause Firefox to become stuck. Like I am 21 MB, it usually takes about a year.

What is stored in this file? Let me use the extension SQLite Manager to see:

In pai_favicons, The Favicon of more than 1500 sites is saved, that is, the Logo icon of the website.

In the pai_historyvisits table, all access records are saved. Here are 60 thousand records!

There are more than 30 thousand places: Address, title, and Reverse Domain Name Information in the pai_places.

What is the impact of these data volumes on Firefox's performance? I tried to rename places. sqlite and restart Firefox.

All pauses and cards no longer exist! Firefox becomes very fluent.

Of course, the problem is that all historical records and address bar information are missing, which is equivalent to "clearing privacy records, this is more advanced than "Tools"> "Clear privacy records.

Therefore, it is concluded that when using Firefox, as long as you want to visit the website, it will frequently operate the database, because the database is very large, it affects the query efficiency, so it will become stuck. When Firefox is disabled, it is necessary to write and save the database. Because the file size is large, it is not surprising to pause for a long time.

Clear Data

The reason is that there is too much data in this file. If you have no requirements on the Current History and record, simply delete it.

Alternatively, you can use "Tools"> "Clear privacy records" to specify some deletion options, which also has good results. However, this does not make the file smaller. You need to use SQLite Manager, select the Database and choose Database> Compact Database. This will compress the database and reduce the number of files.

It is better if you are familiar with SQL data operations. You can clear the database with a reserved record.

In the pai_places table, there is a field (frencency) that records the "frequency of each entry". Through this, you can query and delete all records that are not commonly used in SQL statements. Only some common records are left.

For example, the commonly used record value of frencncy is generally 0, and the website accessed once in two or three days may be 140, and The Gmail I access every day is 6000!

Permanent Optimization

"OK, I will also manually clear the historical records to make Firefox faster. The question is how to stop it from slowing down ?"

Let's change the Hidden setting of Firefox so that it has fewer record entries, so we don't have to clear it regularly.

Enter: about: config in the address bar, and input history in the filter. Note that the entries in the figure prefixed with browser. history_expire:

Browser. history_expire_days: indicates the Expiration days of the history record. The default value is 180 days!

Browser. history_expire_days.mirror: This is unknown. Is it related to the image?

Browser. history_expire_days_min: indicates the user value. That is, in "Firefox Preferences", "privacy", and "History", "Save my history for at least X days ". Even if you set "at least X days" in your preference to 1 day, or cancel, Firefox will still save the browsing history because the system retains the browsing history for 180 days.

Browser. history_expire_sites: the maximum number of websites to be saved. The default value is 40 thousand.

That is to say, the system either saves the 180-day record or 40 thousand browsing records, but how did my pai_historyvisits reach 60 thousand? This table may be named orders _places.

After almost understanding it, set the value to the following. The number of sites is enough to save four thousand. The system saves 3-day browsing records, and the user has at least one day. The mirror has a random value.

Note that if you have not manually cleared places. sqlite and set these values, the file will not change. You still need to manually clean it.

Next, we will use practice to test everything. In the next six months, we will query the places. sqlite record to see if it is restricted to less than four thousand. In this case, Firefox will no longer be stuck.

In addition, we recommend that you remove two options, "Preferences", "security", and "suspected attack sites" and "counterfeit sites". The files related to these two items will also be quite large. However, it's no exaggeration for places. sqlite.

 

Related Article

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.