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

All bugs related to the 3D engine
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post 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
Last edited by pf shadoko on Tue May 16, 2023 8:31 pm, edited 3 times in total.
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

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

Post by Caronte3D »

377ms on my old computer i7 4Ghz
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

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

Post by STARGÅTE »

No problem here: 277 ms

Ryzen 9 3900X, 3.79 GHz
GeForce RTX 3080
Windows 10, x64
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post 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
Mindphazer
Enthusiast
Enthusiast
Posts: 340
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

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

Post 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
MacBook Pro 14" M1 Pro - 16 Gb - MacOS 14 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

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

Post by Caronte3D »

With the new code...
texture: 369
image: 25
ratio: 14.8
OS: 110 PB: 602
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

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

Post 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
Image
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

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

Post by jacdelad »

texture: 4727
image: 40
ratio: 118.2
OS: 110 PB: 601
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post 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...
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

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

Post 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.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

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

Post by Caronte3D »

pf shadoko wrote: Tue May 09, 2023 4:02 pm ...maybe the grapfics system...
Mine:
NVIDIA GeForce GTX Titan Xp 12GB GDDR5X
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

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

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post by pf shadoko »

I tested with directx :
The creation of textures is instantaneous !
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post 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
Post Reply