1

Some programs like Firefox only use up to maximum 25% of all CPU (only 1 thread).

However some programs like WinRAR, use up to 100% of all CPU.

How can I force Firefox to use all capacity of CPU (like WinRAR)?

I have Windows 7 and Intel Core-i5 CPU (4 Thread).

4
  • 1
    Why would you want to...? Firefox doesn't need all those resources, for example, whereas winrar could.
    – nerdwaller
    Dec 12, 2012 at 19:44
  • @nerdwaller some programs need high CPU but only use 25% of it. firefox is an example.
    – EmRa228
    Dec 12, 2012 at 19:46
  • Guess I didn't realize that Firefox was so resource hoggy, sorry - just asking :D
    – nerdwaller
    Dec 12, 2012 at 19:46
  • I see these things in task manager, but what does using a percentage of a processor mean?
    – barlop
    Dec 12, 2012 at 20:45

5 Answers 5

7

Some tasks can benefit from parallelism.
For instance if one person can build one house in 9 months, then (maybe) 9 people can build one house in one month.

But some tasks cannot benefit from parallelism.
For instance a woman can conceive & give birth to a baby in 9 months, then getting 9 women to produce one baby in one month will never happen.

Firefox is essentially an input-response program.
You type in a URL or click on a link.
Firefox issues a request to retrieve the web page from a remote server, and then waits.
When the web page is delivered, Firefox processes this input and renders it on the screen.
Firefox then waits for your next input action.

Firefox is a program that will not (significantly) benefit from parallelism.
So Firefox (apparently) is implemented as a single-threaded program to use only one core.
Whereas other programs, that are computational intensive and implemented as multi-threaded, such as WinRAR, do benefit from parallelism and are executed on several processors/cores.

3
  • 1
    IE and Chrome are able to process multiple tabs at once using the full CPU instead of messing around and tripping on threads. Often the entire Firefox freezes due to trivial things like one single tab rendering some snowflakes in JavaScript. Jul 17, 2014 at 14:20
  • I think this answer is incorrect, despite the votes and being marked as best answer. The problem isn't retrieving a document. Rendering a web page can be very computational intensive and Firefox doesn't fully use both cores in my notebook. This makes the rendering of some pages veeeery laggy...
    – Diego
    Dec 15, 2016 at 23:02
  • @Diego -- Try rereading the question and focus on the the last paragraph, especially the second sentence. Otherwise submit your own answer to the question. Note that the question is not why Firefox (or rendering web pages) is slow. Also note that this answer is four years old, and web pages have gotten more complex. "Firefox doesn't fully use both cores in my notebook." -- And the second sentence in the last paragraph explains why.
    – sawdust
    Dec 16, 2016 at 0:35
5

You can't, only the developer of the program can.

The only option you have is if you want 100% CPU usage is open 4 copies of the program, each copy will take a core up.

10
  • I install XAMPP and use mysql and httpd(apache service). my database have 5,000,000 record and run a query take long while to do, because them use only 25% of CPU. any solution?
    – EmRa228
    Dec 12, 2012 at 19:51
  • 1
    You did not ask about mysql, you asked about firefox. Please post your REAL question, you are falling in to the XY problem. There is DEFFINATLY stuff we can help you make mysql faster. Dec 12, 2012 at 19:52
  • i have this problem(25% use) with other programs, like firefox, dreamwevaer, notepad++ and etc.
    – EmRa228
    Dec 12, 2012 at 19:55
  • It is an API call, and there is software that can make that call (apparently affecting or on behalf of other software, or on behalf of the techie himself, whatever one's perspective is!) process hacker can make that API call, as apparently can "Process Lasso" from bitsum.com mentioned superuser.com/questions/136021/… That can change IO Priority, The thing is though, is that the right one, and are there more pertinent ones to change?
    – barlop
    Dec 14, 2012 at 7:10
  • @barlop that just changes priority, you still be stuck with one core at 100% and the other 3 at 0% (leaving you with 25% CPU usage) Dec 14, 2012 at 7:16
3

Threads in Windows run until either their quanta (time slice) ends, they block (e.g., doing i/o that hasn't completed) or they're interrupted to run something higher priority that's just become ready.

Windows allows bumping the priority of a thread, all the way up to THREAD_PRIORITY_TIME_CRITICAL. But even the highest priority threads are occasionally interrupted to run lower-priority threads by the Windows scheduler, which uses random boosts to avoid a deadlock condition called priority inversion.

How or when an application creates new threads and what they do is a design decision embedded into the internal logic of the program, not something you can control except perhaps through the way you use the application, e.g., opening more tabs or whatever.

Bottom line is that if you're wondering what it takes to max out CPU usage as much as possible, the answer is takes a CPU-intensive activity with as many threads as you have processors, doesn't block on i/o and runs at higher priority (e.g., just being the foreground app) than other tasks.

8
  • that is very informative. Would this be of use to him? superuser.com/questions/136021/… if so you could update your answer. Process hacker can change "IO priority" of a process or I suppose, the priority of all the process's threads or individual threads of it. Is that the priority he'd want to change? process hacker can make that API call, as apparently can "Process Lasso" from bitsum.com (a program which an answerer in that aforementioned su thread , works on). Is IO priority THE thing he'd want to change? or a thing ?
    – barlop
    Dec 12, 2012 at 20:59
  • With all your knowledge about thread priorities, can you really not answer whether that is the priority he should go for changing? and whether other thread priorities are more pertinent?
    – barlop
    Dec 14, 2012 at 7:06
  • If a thread does i/o, there's a good chance it will block because i/o devices like disks are mechanical and very slow by comparison to the processor. For that reason, changing the i/o priority is unlikely to be anywhere near as effective as simply not doing i/o if your objective is to max out the processor. Dec 14, 2012 at 7:59
  • @barlop Increasing the priority of a process doesn't help it run faster, unless there is some other process also trying to use CPU. See my answer here: superuser.com/a/964389/348119 Mar 10, 2018 at 1:12
  • @JamieHanrahan of course (and the misconception in the mind of the question you answered is not one i've ever had nor is it one that this questioner has), but it's pretty common that there are other processes trying to use the cpu, there's almost never just one process. And the questioner asked "How can I force Firefox to use all capacity of CPU" surely the answer is to increase its priority. And of course, it also goes without saying that if the process is not running anything then the OS will be smart enough to not give it any CPU time!
    – barlop
    Mar 10, 2018 at 3:02
1

No. Threading is a decision made by the application developer, and can only be used (or at least be beneficial) in certain cases. additionally, the CPU is only one component that may be taking execution time, and as such, if its waiting on disk or high frequency ram updates, then the CPU would still act exactly as you have described, despite the app being multithreaded and on a multicore chip.

1

Mozilla Firefox is based on software that was written before CPUs with multiple cores got popular. As such it still uses a single process with complicated threading system that is not easy to split into separate programs. You could vote for and participate in the Electrolysis project:

The goal of the project is to run web content in a separate process from Firefox itself. The two major advantages of this model are security and performance. Security would improve because the content processes could be sandboxed (although sandboxing the content processes is a separate project from Electrolysis). Performance would improve because the browser UI would not be affected by poor performance of content code (be it layout or JavaScript). Also, content processes could be isolated from each other, which would have similar security and performance benefits.

Although the Gecko platform supports multiple processes, the Firefox frontend is not designed to use them. Work to make the frontend (including addons) support multiple processes was begun in early 2013. The project roadmap has more details.

Microsoft Internet Explorer and Google Chrome are already able to process multiple tabs at once using the full CPU instead of messing around and tripping on threads. Often the entire Firefox freezes due to trivial things like one single tab rendering some snowflakes in JavaScript.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .