Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: computational efficiency

by Old_Gray_Bear (Bishop)
on Oct 05, 2011 at 14:37 UTC ( #929817=note: print w/ replies, xml ) Need Help??


in reply to computational efficiency

The three steps to writing Good Code:

  1. Make it run
  2. Make it run right
  3. Make it run fast
Keep your notes about optimization around for when you get to the third step. (No, I don't remember who said it; probably Kernigan.)

Update -- fixed typo

----
I Go Back to Sleep, Now.

OGB


Comment on Re: computational efficiency
Re^2: computational efficiency
by thelycaeum (Initiate) on Oct 10, 2011 at 17:42 UTC
    First of all, thanks for all of your replies.

    BrowserUK: I'll try that one, I think it's exactly the benchmark code I was looking for.

    Perlbotics: Quantizing the angles seems to be a good idea. At first glance, the following problem arises in my mind: To achieve random 3D rotation, I have to apply rotations around the x,y and z axis. Do you think I could achieve a random probability distribution by simply randomizing the rotation axis and walking through the quantized angles with a foreach loop?

    Lotus1 & moritz: Thanks moritz, I thought about that shortly after the post. I could get rid of that problem by randomizing the sign of the cosine... shouldn't I? I'll think about that and read the article lotus posted, I don't understand it yet.

    zentara: Actually, I intend to learn how to use PDL by writing that program. However, I wanted to get started by writing a backbone in Perl and only solve the more sophisticated problems with PDL. I was having some problems with the notation of complex values in the PDL:FFTW package before, therefore I was wondering what I could program in Perl efficiently and what not.

    roboticus: Very good point, I'll do some analysis on the probability distribution for both methods using BrowserUK's code and I'll work on the point moritz made about the two vs. four quadrants.

    hardburn: I've messing around with POGL a bit, but I think it's too much for me... yet ;)

    Old_Gray_Bear: Thanks, I don't have much programming experience and so I was looking for some hints on how to plan this project.

    Thanks again for all of these great comments :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-08-20 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (113 votes), past polls