Why can a computer take minutes to run a couple lines of code, yet can run complex things like games so quickly?

753 views

Why can a computer take minutes to run a couple lines of code, yet can run complex things like games so quickly?

In: Technology

10 Answers

Anonymous 0 Comments

One thing which I can’t see being covered in other comments is parallel processing. Most games / graphic based softwares use the GPU, functioning of GPU is very different from a CPU. It has a large pool of lower clock speed (lower performance) processors. If I were to figure out the color of a pixel to be displayed in an intense fighting game, I would dedicate a single part of GPU to it, there can be millions of these on a current gen GPU. This is how it can calculate multiple frames in the time taken to display a single frame.

A typical code is run on a CPU which has a much higher clock speed but a single processor being used for the execution, so it can take longer (can take shorter too if the code can’t be made to execute in parallel)

You are viewing 1 out of 10 answers, click here to view all answers.