2

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).

kenorb
  • 26,615
Emad Rahnama
  • 155
  • 2
  • 2
  • 12

5 Answers5

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.

sawdust
  • 18,591
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.

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.

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.

Frank Thomas
  • 37,476
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.