I need a few easily implementable single cpu and memory intensive calculations that I can write in java for a test thread scheduler.
They should be slightly time consuming, but more importantly resource consuming.
Any ideas?
Sorting, search, graph traversal, matrix multiply are all CPU operations, a process is CPU-intensive or not it depends on how much and how frequent are their execution.
Compute-intensive is a term that applies to any computer application that demands a lot of computation, such as meteorology programs and other scientific applications. A similar but distinct term, computer-intensive , refers to applications that require a lot of computers, such as grid computing .
A processor intensive task is any task that is speed limited by how fast the processor can compute the data. Example: encoding video. A memory intensive task is any task that is speed limited by how fast the memory can feed data to the processor.
So Java is CPU-intensive compared to the same program written in C. Java is not interpreted at runtime, at least not as most people would think of interpretation as being. In any competent JVM, Java bytecode is JITed into native code and then executed. Yes, this is slower than running native code.
A few easy examples of CPU-intensive tasks:
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