FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   Optimization...
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Optimization...  (Read 359 times)
ess

Email
Optimization...
« on: Apr 23rd, 2004, 9:56pm »

Hi, I'm new to Processing (about 2 weeks) and programming in general.  But so far I've found p5 intuitive and it looks like a great group of people are gathering around here to share ideas.
 
I made a couple of test applets, but here is my first object oriented program (it's just a study for a bigger project):
 
http://mywebpages.comcast.net/warptera/p5/Window_Panes/
 
My question is about optimization.  I realize this type of knowledge probably only comes with experience, but do you guys have any general tips for a beginner?  For instance, a friend told me that "variable*.5" requires less resources that "variable/2".  Specifically I was wondering if someone could look at the way I populated the arrays containing the X,Y coors for each pane.
 
thanks
 
Quasimondo

WWW Email
Re: Optimization...
« Reply #1 on: Apr 23rd, 2004, 10:18pm »

Hi ess,
 
maybe you have missed the Technotes page: http://processing.org/reference/technotes/index.html (I didn't know about it for quite a while) - there you'll find two links to Code Optimization:
 
http://processing.org/discourse/yabb/board_Contribution_Simlati_on_action_display_num_1053924129.html
 
http://processing.org/discourse/yabb/board_Programs_action_disp_lay_num_1067898264.html
 
In your special case I would use the expression
 
variable>>1
 
as it's of type int
 
 

Mario Klingemann | Quasimondo | Incubator | côdeazur
Pages: 1 

« Previous topic | Next topic »