I am working on a site that uses jQuery and has a fair amount of javascript that is run using $(document).ready()
. On my dev machine everything runs great but it's a pretty powerful machine. I have had reports from people using older hardware of behavior that seems strange and I am fairly convinced that it is down to the time taken to process this initial javascript on slower machines.
Clearly, the solution is to sort out this initial javascript but it got me wondering - does anyone know of a way to slow down the execution speed of javascript in either Chrome or Firefox to be able to simulate these slower clients on my dev machine?
Cheers!
Update: Back when this question was posted, there weren't the same set of tools that there are today. At that time the VM option was the best option therefore I am leaving it as the accepted answer. However these days I would go straight for Chrome dev tools instead as suggested by Oded Niv
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. Save this answer.
Under Chrome developer tools -> Timeline
you now an option to throttle down the CPU, look for the dropdown:
UPDATE:
Chrome(ium) changed in new versions, it is now under the Performance
tab, and you have to click the settings button in the corner for this feature to show up:
This might not be the best solution, but something that could definetely work is to run a virtual machine, there you could specify all hardware specs as long as they are lower than you real machine. Look at this post
I would use a VM and just limit it's resources. If you are not a fan of virtual machines, then I would go find an old machine at a yard sale, thrift store etc. and use that as a testing platform. You can never patch it, fill it up with crappy malware laden programs and then it will be just like the experience for an "average user." :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With