CPU Intensive Calculation Examples?

后端 未结 7 815
轻奢々
轻奢々 2020-12-01 05:12

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 con

7条回答
  •  臣服心动
    2020-12-01 06:00

    Multiply two matrices. The matrices should be huge and stored on the disk.

    String search. Or, index a huge document (detect and count the occurrence of each word or strings of alphabets) For example, you can index all of the identifiers in the source code of a large software project.

    Calculate pi.

    Rotate a 2D matrix, or an image.

    Compress some huge files.

    ...

提交回复
热议问题