Post Reply 
RECT_P but without filling
11-30-2015, 08:42 PM
Post: #9
RE: RECT_P but without filling
That's funny I made same kind of test, but I didn't test same thing as you.
I didn't think about colors, but about rectangle size.
I guess bigger rectangle may be slower.
here is my code, I'm varying the rect size.
Code:
RECT_P_NOFILL0(x,y,x2,y2,col);
RECT_P_NOFILL(x,y,x2,y2,col);

EXPORT test1()
BEGIN
local a,b;
local t;
RECT_P();
t:=TICKS;
 for a from 1 to 30
 do
  for b from 1 to 30
  do
// change comment here
     RECT_P_NOFILL(a+b*2,b+a*2,50+a*3+(b-15)*6,100+a*2+b*3,#0h);
//     RECT_P_NOFILL0(a+b*2,b+a*2,50+a*3+(b-15)*6,100+a*2+b*3,#0h);
  end;
 end;
t:=TICKS-t;
msgbox(t);
END;

RECT_P_NOFILL0(x,y,x2,y2,col)
begin
   RECT_P(x,y,x2,y2,col,#FFFFFFFFh);
end;

RECT_P_NOFILL(x,y,x2,y2,col)
begin
 LINE_P(x,y,x2,y,col); //top
 LINE_P(x,y2,x2,y2,col); // bottom
 LINE_P(x,y,x,y2,col); //left
 LINE_P(x2,y,x2,y2,col); // right
end;
results are :
* avg 313 for RECT
* avg 460 for LINEs
LINEs solution is about 50% slower than RECT.

Your bench show about 30% slower, in both case RECT is better.

primer
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RECT_P but without filling - hpfx - 11-27-2015, 01:35 PM
RE: RECT_P but without filling - DrD - 11-27-2015, 02:46 PM
RE: RECT_P but without filling - primer - 11-27-2015, 03:18 PM
RE: RECT_P but without filling - primer - 11-30-2015, 09:04 AM
RE: RECT_P but without filling - eried - 11-30-2015, 03:33 PM
RE: RECT_P but without filling - eried - 11-30-2015, 06:28 PM
RE: RECT_P but without filling - primer - 11-30-2015 08:42 PM
RE: RECT_P but without filling - Han - 11-30-2015, 09:55 PM



User(s) browsing this thread: 1 Guest(s)