Speed-Difference: Win 7 and XP -> Drawing lib

Everything else that doesn't fall into one of the other PB categories.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Speed-Difference: Win 7 and XP -> Drawing lib

Post by Marco2007 »

Hi,

has anyone made the same experiences?
My App is on XP fast and on Win 7 very, very slow, when I wanna display something with OpenWindowedScreen....

Btw: I´m not the person, who counts milliseconds...

br and thx
Marco
Last edited by Marco2007 on Thu Nov 19, 2009 11:35 pm, edited 5 times in total.
PureBasic for Windows
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: OpenWindowedScreen very slow on Win 7 :-(

Post by Kaeru Gaman »

subsystem?

... using DX7 on Win7 or Vista needs to switch off Aero, wich not only takes time but also has optical side effects.
oh... and have a nice day.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: OpenWindowedScreen very slow on Win 7 :-(

Post by Marco2007 »

I use the new standard Direct9X (4.40b7), but also same result with 4.31 and sub Dx9.
I`m so surprised, because it`s soooo slow...I will cut the code to a minimum...

....there something wrong with OpenWindowedScreen and for/next ...but I don`t know what...
App is running for about 1.5 years without any problems on XP (since 4.02), but on Win 7 it`s very slow...

***** Edit:

Could anyone please try this code on Win 7 and XP:

Code: Select all

If InitSprite() = 0 : End : EndIf

If OpenWindow(0, 0, 0, 220, 160, "A screen in a window...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If OpenWindowedScreen(WindowID(0), 0, 0, 160, 160, 0, 0, 0)

   For f=0 To 100
      For i=270 To 810 Step 1
        StartDrawing(ScreenOutput())
        StopDrawing()
      Next
   Next   
  EndIf
EndIf
XP -> finished within a second
Win7 -> about 5 seconds...

I changed to:

Code: Select all

StartDrawing(ScreenOutput())
For f=0 To 100
  For i=270 To 810 Step 1
  Next
Next   
StopDrawing()
...but I´m really surprised, why there`s so much difference between XP and Win 7...

thx
PureBasic for Windows
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: Speed-Difference: Win 7 and XP -> Drawing lib

Post by moogle »

Takes around 4-5 seconds to end for me on Vista :) (4.40b7 x86)
Image
PureLust
Enthusiast
Enthusiast
Posts: 486
Joined: Mon Apr 16, 2007 3:57 am
Location: Germany, NRW

Re: Speed-Difference: Win 7 and XP -> Drawing lib

Post by PureLust »

It seems to be the ScreenOutput() (as you can see by trying the attached code).
Buffering the ScreenOutput() will maybe not work if you have a FlipBuffers() within the Loops.

BUT - if you don't have a FlipBuffers() within the loop, you should do it the "new" way (the 2nd way you posted above) anyway.

The following code will end within Milliseconds on Vista as well:

Code: Select all

If InitSprite() = 0 : End : EndIf

If OpenWindow(0, 0, 0, 220, 160, "A screen in a window...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If OpenWindowedScreen(WindowID(0), 0, 0, 160, 160, 0, 0, 0)
    Timer1 = ElapsedMilliseconds()
    ScrOut = ScreenOutput()
    For f=0 To 100
      Dummy = WindowEvent()
      For i=270 To 810 Step 1
        StartDrawing(ScrOut)
        StopDrawing()
      Next
    Next   
    Timer2 = ElapsedMilliseconds()
    MessageRequester("Duration",Str(Timer2-Timer1)+"ms")
  EndIf
EndIf
Greetz, PL.
[Dynamic-Dialogs] - create complex GUIs the easy way
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: Speed-Difference: Win 7 and XP -> Drawing lib

Post by SFSxOI »

PureLust, your code in the post above mine takes 47 ms on Windows 7 here.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: Speed-Difference: Win 7 and XP -> Drawing lib

Post by Marco2007 »

hmm...Bug?
PureBasic for Windows
Post Reply