Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good math functions that stress the CPU

Anyone know any good math functions that causes a lot of load on the CPU. I am wanting to create a simple program the just creates load for X amount of seconds while another program monitors it. I'm just looking for functions, not actual stress testing programs.

like image 931
Chris Allen Avatar asked Mar 05 '11 18:03

Chris Allen


People also ask

What is a CPU stress test?

What is a stress test? A CPU stress test analyzes the performance capabilities of your computer by subjecting it to maximum usage over a prolonged period of time. By pushing your PC's processing power to the limit, CPU load tests help you evaluate how much your hardware can handle.


2 Answers

The Computer Language Benchmark Game has quite a few benchmarks, many of which are math-based. It's a good source because the source code for each algorithm is included and there are implementations of each benchmark in dozens of languages. That way, you can just use the implementation in whatever language you're comfortable compiling and running.

like image 95
Rafe Kettler Avatar answered Oct 03 '22 10:10

Rafe Kettler


Try the Lucas-Lehmer primality test. It's what's used in the Prime95 executable, and Prime95's fairly standard for CPU stress testing.

like image 40
Marc B Avatar answered Oct 03 '22 10:10

Marc B