Slow down CPU to simulate slower computers in browser testing

廉价感情. 提交于 2019-11-29 09:11:56

In multi core systems running vista or better you can set the cpu affinity forcing the browser to run only on a single core

For example

c:\windows\system32\cmd.exe /C start /affinity 1 notepad.exe

Individual cores on most machines these days aren't significantly faster than a couple of generations ago. That said you will find that due to architecture changes the cache is probably larger and the ram will be faster both of which make a significant difference.

Have you considered just buying an old pc from ebay or your local free adds. I suspect the cost in wages of having a member of staff do the necessary research, set up your limited ram vm and add core binding shortcuts for the major browsers etc would buy you a fair few old boxes, complete with older os (and if your really lucky all the last owners spyware and browser toolbars for an extra accurate simulation of your end users pcs)

This is a fast solution, but not very accurate when it comes to end-user specs, but it helps a lot to test things on slower systems:

Go to Power Options -> Create a power plan -> Change advanced power settings and set CPU Maximum Rate to 5% or how much you need.

This usually helps test browser apps on slower configs.

Seems like it would be simpler to acquire an "average customer's computer" on the used computer market.

Or build it yourself from parts.

Neek Sandhu

Adding to CatalinBerta's answer which worked great for me. You also need to keep in mind that it's not just the CPU you want slow down.

Browsers typically rely on GPU's for painting and composting the webpage as well as for complex animations. If you want to simulate worst case scenario, try disabling all of your Display Adapters in Device Manager, which will closely resemble clients using computers at public libraries.

For Windows:

Start > search "Device Manager" > Expand Display Adapters > right click each item > Disable

Found a solution for this on Mac as well.

http://jesperrasmussen.com/blog/2013/03/07/limiting-cpu-cores-on-the-fly-in-os-x-mountain-lion/

Using the instruments app, you can limit the CPU usage of one or all running processes.

I created a free simple tool for Windows that allows anyone to enter the process ID and the desired CPU speed percentage, and it proceeds to simulate a slow CPU for that process. The utility itself barely consumes CPU time, which is a benefit. :)

It's called "Slow CPU Emulator", check it out here: https://github.com/mathusummut/SlowCpuEmulator

Precompiled binaries can be found here: https://sourceforge.net/projects/slowcpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!