Try this
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Try this
Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370
Thanks nice link and program. Fractals are amazing and always fun to look at!
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Thanks Abraxas.
Those kind of scripts shows the limit in interpreted languages.
I will use it to study more tricks to add more execution speed.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Nice fractals!,
Mandelbrot is good, I tried to optimize Abraxas code a bit, but I got only 20% increase
[code=thinbasic]
SUB DoBRot()
local t1, t2 as long
local wminone as long = width - 1
local hminone as long = height - 1
TBGL_BeginPoly %GL_POINTS
xmin = -2.0
ymin = -1.3
xmax = 1.0
ymax = 1.3
integralX = (xmax - xmin) / width
integralY = (ymax - ymin) / height
x = xmin
For S = 1 To wminone
y = ymin
For Z = 1 To hminone
x1 = 0
y1 = 0
looper = 0
While (looper < 1000 And Sqr( x1*x1 + y1*y1 ) < 2)
Looper += 10
xx = x1*x1 - y1*y1 + x
y1 = 2*x1*y1 + y
x1 = xx
WEND
TBGL_Color ColorMap_R(Looper), ColorMap_G(looper), ColorMap_B(looper)
TBGL_Vertex s,z
y += integralY
Next
x += integralX
Next
TBGL_EndPOLY
END SUB
[/code]
I just put tbgl_BeginPoly/tbgl_EndPoly out of the loops as it is not necessary for each point, added += on two places, removed () where not needed. I am sure it could be speeded up even more somehow, but I am don't how to do it
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Ok,
here is version which should run 47% faster - using FOR/NEXT with step !
[code=thinbasic]
SUB DoBRot()
local t1, t2 as long
local wminone as long = width - 1
local hminone as long = height - 1
TBGL_BeginPoly %GL_POINTS
xmin = -2.0
ymin = -1.3
xmax = 1.0
ymax = 1.3
integralX = (xmax - xmin) / width
integralY = (ymax - ymin) / height
x = xmin
For S = 1 To wminone
y = ymin
For Z = 1 To hminone
x1 = 0
y1 = 0
for looper = 0 to 1000 step 10
if Sqr( x1*x1 + y1*y1 ) >= 2 then exit for
xx = x1*x1 - y1*y1 + x
y1 = 2*x1*y1 + y
x1 = xx
next
TBGL_Color ColorMap_R(Looper), ColorMap_G(looper), ColorMap_B(looper)
TBGL_Vertex s,z
y += integralY
Next
x += integralX
Next
TBGL_EndPOLY
END SUB
[/code]
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
thanks Petr.
Ive added some different sub routines to give you timing examples.
DoBrot1() '= 14.5 seconds
DoBrot2() '= 14.2 seconds
DoBrot3() '= 11.2 seconds
DoBrot4() '= 14.0 seconds
how does it compare on your machine?
Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370
Similar time here:
1: 12,6
2: 14,2
3: 10,3
4: 12,7
A great example to be used to make optimization.
Thanks a lot
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Hi,
grr, worst results
CPU is AMD Sempron 64 3400+ ( 1.8GHz real freq )
- 18.68
- 18.03
- 14.77
- 18.33
Really nice benchmark!
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
The biggest time is loosed in
[code=thinbasic]
While (lo < 1000 And Sqr( x1 * x1) + (y1 * y1) < 2)
Lo += 10 ' the loop counter
xx = x1 * x1 - y1 * y1 + x
y1 = 2 * x1 * y1 + y
x1 = xx
incr counter
WEND
[/code]
Commentig out the full WHILE/WEND it takes just half second.
I've added a counter to be able to check how many times it is executed that while.
In DoBRot1 WHILE/WEND is executed 3.729.844 times. A lot for an interpreter but I'm sure I will get some more optimization.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks