Re: sloooooww
- Posted by Cameron Kaiser <spectre at WWW2.BUOY.COM> Oct 23, 1997
- 877 views
Optimization, my friend, optimization! > procedure write_buff() > for y = ymin to ymax-2 do > poke(a+320*y+xmin,buff[y-ymin+1]) > end for > end procedure How about adding 320 instead of multiplying by it? i.e. poke(a+q+xmin, ...) q = q + 320 This would be much, much faster. And since write_buff() gets called a lot ... Also see about stuffing some of your calculations in a lookup table, or at least sticking predictable values in a table to reduce the amount of multiplications you have to do. Mults and divs kill execution time. -- Cameron Kaiser http://www.sserv.com/ spectre at sserv.com --