Don't use LineXY(), use Line() instead.

Share your advanced PureBasic knowledge/code with the community.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

@MrMat, I found earlier that if I plot() the last pixel then linexy() works out at about the same time as line() so that is probably what is happening internally, like you said.

@GeoTrail, well I'm glad someone is getting a reasonable speed increase, thought it was just me going mad. :)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

On Derek's last example I got the following on a laptop with sis VGA and AMD sempron 3000+
  • Average linexy = 17
    Average line = 5
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Mad cow? yaaaiks heheehe ;)

Anyways, here's my laptops hardware:
AMD Turion 4 Mobile 2 GHz
256 MB ATI Xpress 1100
1 GB DDR2
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

linexy 9
line 5

Intel Pentium M 1.70 GHz
2 GB RAM
ATI Mobility Radeon 7500 (32 MB DDR SGRAM / SDRAM, AGP 4X mode)
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Post by MrMat »

Derek wrote:@MrMat, I found earlier that if I plot() the last pixel then linexy() works out at about the same time as line() so that is probably what is happening internally, like you said.
Yes my debugging was in OllyDbg and it definitely is! Similar results here (but slower!):
Average linexy = 39
Average line = 27
Is anyones slower than that?! :lol:
Mat
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Well, mine is one of the slowest so I am guessing that it is governed by the graphics card but I was under the impression that graphics cards were more or less the same as far as 2D was concerned, obviously not.
MrMat
Enthusiast
Enthusiast
Posts: 762
Joined: Sun Sep 05, 2004 6:27 am
Location: England

Post by MrMat »

Mine is an onboard Intel chip (i can't remember the name). It is so much slower than the Radeon 9800 i was using until it broke. The most annoying thing was having to phone Microsofts activation people just because i took the card out and Windows decided i had changed too much hardware. Grr!
Mat
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Yeah, I had that once with my old computer, at least it's a freephone number.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re:

Post by Psychophanta »

Psychophanta wrote:On Derek's last example I got the following on a laptop with sis VGA and AMD sempron 3000+
  • Average linexy = 17
    Average line = 5
In PB4.40 thing go worse sometimes:
  • Average linexy = 17
    Average line = 17
but other times i get:
  • Average linexy = 7
    Average line = 7
And by the way, WindowEvent() before StopDrawing() has problems now in the windowed screen.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Don't use LineXY(), use Line() instead.

Post by Kaeru Gaman »

since drawing was completely changed, the whole thread became obsolete.

now LineXY() and Line() use the same algorithm, but Line() no longer draws lines with width or heigth 0.

oh, and btw...
when you want to test performance, make sure results are above 100ms.

results like "7 or 17" are just "one or two timeslices", that's just a marginal difference depending on coincidence...
oh... and have a nice day.
User avatar
Michael Vogel
Addict
Addict
Posts: 2810
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Don't use LineXY(), use Line() instead.

Post by Michael Vogel »

Kaeru Gaman wrote:since drawing was completely changed, the whole thread became obsolete.

now LineXY() and Line() use the same algorithm, but Line() no longer draws lines with width or heigth 0.

oh, and btw...
when you want to test performance, make sure results are above 100ms.

results like "7 or 17" are just "one or two timeslices", that's just a marginal difference depending on coincidence...
Right - a lot of things have changed :|
Hopefully the help file will be corrected, because the description of the "target point" is wrong (some say, this is the only right thing with Line now :wink: )
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: Don't use LineXY(), use Line() instead.

Post by Psychophanta »

Yes, things have been changed, but does someone tested the current speed of line and linexy in front of the PB4.31?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Don't use LineXY(), use Line() instead.

Post by Kaeru Gaman »

I have the confirmation from Fred himself that the Routine now is identical only the call ist slightly different.
you can search the forums, somewhere in to Line-topics he said so.

the old LineXY had an additional call of Plot to put the ending dot, so it was slower.
oh... and have a nice day.
Post Reply