Page 1 of 1

StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Mon May 08, 2023 6:33 pm
by pf shadoko
not really a bug but...
while trying to optimize Landscape v9 I realized that StartDrawing(TextureOutput(i)) was taking a long time
on my config , 10 textures of 2048 x 2048 take 3s

(note: there is not this problem in directx, the creation of textures is instantaneous)

in the code I display the time taken by createtexture and createimage
note : the comparison is not relevant, but the difference of ratio between the different configurations can be interesting
(it is probably normal that createtexture is slower (creation of MIP-MAP, access to the graphic memory...)
thank you for posting the content of the debugger

Code: Select all

InitEngine3D():InitSprite()
OpenWindow(0, 0,0,100,100,"")
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)

t0=ElapsedMilliseconds()
For i=1 To 10
  CreateTexture(i,2048,2048)
  StartDrawing(TextureOutput(i))
  StopDrawing()
Next
t1=ElapsedMilliseconds()-t0
Debug "texture:"+#TAB$+t1

t0=ElapsedMilliseconds()
For i=1 To 10
  CreateImage(i,2048,2048,32)
  StartDrawing(ImageOutput(i))
  StopDrawing()
Next
t2=ElapsedMilliseconds()-t0
Debug "image:"+#TAB$+t2
Debug "ratio:"+#TAB$+FormatNumber(t1/t2,1)
Debug "OS: "+OSVersion()+#TAB$+" PB: "+#PB_Compiler_Version
me:
texture: 2835
image: 46
ratio: 61.6
OS: 120 PB: 601

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Mon May 08, 2023 10:01 pm
by Caronte3D
377ms on my old computer i7 4Ghz

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 6:01 am
by STARGĂ…TE
No problem here: 277 ms

Ryzen 9 3900X, 3.79 GHz
GeForce RTX 3080
Windows 10, x64

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 9:45 am
by pf shadoko
surprising, I'm 10 times slower (I don't think that the difference between machines can explain this difference (intel N5105 in my case))
but even in your case I find it slow...

I modified the test code to have the OS version and especially the PB version
thank you for posting the content of the debugger

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 10:53 am
by Mindphazer
My results (i have not installed PB 6.01 yet)

Code: Select all

texture:	3085
image:	49
ratio:	63.0
OS: 110	 PB: 600

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 12:37 pm
by Caronte3D
With the new code...
texture: 369
image: 25
ratio: 14.8
OS: 110 PB: 602

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 1:54 pm
by Lord
First run:
texture: 637
image: 51
ratio: 12.5
OS: 80 PB: 601

second run:
texture: 648
image: 57
ratio: 11.4
OS: 80 PB: 601

third run:
texture: 657
image: 89
ratio: 7.4
OS: 80 PB: 601

fourth run:
texture: 671
image: 86
ratio: 7.8
OS: 80 PB: 601

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 2:31 pm
by jacdelad
texture: 4727
image: 40
ratio: 118.2
OS: 110 PB: 601

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 4:02 pm
by pf shadoko
thank you for reply
Mindphazer and jacdelad havve the same problem
it doesn't seem to be related to the OS or PB version. maybe the grapfics system...

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 4:06 pm
by jacdelad
pf shadoko wrote: Tue May 09, 2023 4:02 pm thank you for reply
Mindphazer and jacdelad havve the same problem
it doesn't seem to be related to the OS or PB version. maybe the grapfics system...
It's my work computer, good processor but meh graphics.

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 4:41 pm
by Caronte3D
pf shadoko wrote: Tue May 09, 2023 4:02 pm ...maybe the grapfics system...
Mine:
NVIDIA GeForce GTX Titan Xp 12GB GDDR5X

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 09, 2023 7:07 pm
by mk-soft
Graphics Card is not all ...

macOS: Mac Mini 2018, 32 GB Ram

texture: 588
image: 97
ratio: 6.1
OS: 99999 PB: 602
CPU:Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz


VM Window 10

texture: 706
image: 42
ratio: 16.8
OS: 110 PB: 602
CPU:Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz


VM Linux Mint LMDE 5
texture: 729
image: 124
ratio: 5.9
OS: 2000 PB: 602
CPU:Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Tue May 16, 2023 8:33 pm
by pf shadoko
I tested with directx :
The creation of textures is instantaneous !

Re: StartDrawing(TextureOutput(...)) very slow: bug or not ?

Posted: Sat May 27, 2023 9:39 pm
by infratec
texture: 733
image: 40
ratio: 18.3
OS: 110 PB: 602
Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
AMD Radeon HD 7000

All in all a very (s)low PC