Computationally Expensive Operations

Started by
13 comments, last by phresnel 15 years ago
Quote:Original post by raydey
Ok, the exact reason why I want to do this, is basically because I've been assigned to design a pointless and quick experiment for a university project. It's basically using the scientific method (aim, method, results, conclusion etc) and the experiment I decided to do was <!–QUOTE–></td></tr></table></BLOCKQUOTE><!–/QUOTE–><!–ENDQUOTE–><br><br>In university? Really? If it were at the beginning of the year, for a first-year science course, I could accept it… oh, you mean you have to set the task for the students to do at the beginning of the fall 2009 courses? Then let them pick something trivial to study, and warn them that if their experiment involves implementing a system as well as studying it, the implementation might not be as trivial as they think. :)
Advertisement
Quote:Original post by raydey
Hey guys,

Just a quick question. I'm making a very basic program in c++ to calculate the time it takes to process a number of commands. I purposely want to push the processor as far as I can, so I was wondering whether anyone could suggest some CPU intensive operations. I already know about square root being relatively expensive, but was just wondering whether there were any others that were reasonably simple to code.

Cheers

Ray

EDIT: Sorry, I should say, I realise graphics rendering is expensive, but it's not really what I want to code. It's a very basic command line program, for quite a pointless experiment lol


Anything's espensive if you do it enough times.
Fractals. Or, more specifically, the Mandelbrot Set.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Quote:Original post by alvaro
Quote:Original post by ibebrett
factor a large prime.


Factoring primes is a trivial process. I can do it by hand very very quickly. :)
Yeah. Factoring suspected primes on the other hand...
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
If this is for university, then a Whitted style Ray Tracer should be basic enough; but also non-trivial enough w.r.t. codepaths and codelength (of the binary) that the compiler and the CPU won't have a too easy job.

In terms of lines of code (...), I can assure it is not too complex. Look what I said in another recent thread:

Quote:Original post by phresnel
edit: Oh, and of course, to produce a 4k demo, you won't need a millions lines of code ;), in fact, awesome results can be produced in less then 100 lines of code (see Kevin Beason's 100pt: SmallPT: Global Illumination in 99 Lines of C or tbp's sphereflake-in-a-hundred-lines renderer.

(see also the thread on ompf; what I want to say: if you can write a path tracer in 99 LoC, you will even more be able to write a whitted style one in less than 100 LoC)

To unmaterialize that you are not interested in graphics programming: Well, that thing doesn't need more graphical output then dumping to stdout as a ppm file (see linked thread on ompf again).

This topic is closed to new replies.

Advertisement