FBSL, thinBasic & AutoIt3 Comparative Benchmarks

(Vital Data and New Beta Release Info)

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Gerome » Sat Dec 07, 2013 12:48 pm

Yes Mike, 2.8 Ghz
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 05th of December 2011 ::
http://www.fbsl.net/setup/FBSLv3.exe [full v3.4.10 installation pack]
http://www.fbsl.net/setup/FBSLv3bin.zip [minimal upgrade to v3.4.10]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)
User avatar
Gerome
FBSL Administrator
FBSL Administrator
 
Posts: 3149
Joined: Sat Mar 12, 2005 9:06 pm
Location: Paris -- France

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Mike Lobanovsky » Sat Dec 07, 2013 1:38 pm

My Core2 Duo is only 2.2GHz, actually 2206MHz, and it runs the benchmarks twice faster. I think next time when you're about to upgrade your PC, you know what to do. :noel:
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Tue Feb 18, 2014 11:11 am

Just to let you know.

thinBasic is a source code interpreter without any intermediate pCode generation.
Comparing with other languages able to generate optimized intermediate pCode is not fair but ... interesting :-)

To be more fair, I've modified your thinBasic example using a little optimized version in which function "MIterate" is first compiled into machine code using thinBasic Oxygen module and than executed as native function.
Results are the following in my machine: 1670 ticks (for 400x400 pixels) compared to around 9600 of original source code
For 600x600 pixels it takes around 3300 ticks
For 800x800 pixels it takes around 6200 ticks

It is possible to further optimize it transforming main function into Oxygen machine code function.

Attached results and amended thinBasic source code.

Ciao and thanks for those benchmarks, always interesting to compare.
Eros
Attachments
M.zip
(1.24 KiB) Downloaded 140 times
thinBasic_Bench.PNG
thinBasic_Bench.PNG (96.72 KiB) Viewed 3215 times
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Mike Lobanovsky » Tue Feb 18, 2014 6:40 pm

Just to let you know in return, Eros,

The initial benchmark was intended as a purely interpretative test and it didn't contain any JIT tricks at all to be as fair as it only could. Otherwise it would be yet more unfair with respect to AutoIt3. :)

Nonetheless, I'm happy to tell you that your JIT-optimized script runs even faster than that on my XP machine. Yet it's still far, far behind what FBSL can do with its own JIT compilers, either DynC or DynAsm, even under Linux Wine. You can see the relevant screenshots below together with the script that does in FBSL exactly what you did in thinBasic. You can also have a look at what DynC is capable of if used exclusively.

Cheers and thanks for commenting on my submissions and for your interest in FBSL. :)

Appendices

Eros' initial M_TB_O2.tbasic under XP Sp3
Image

Mike's equivalent M_FBSL_C.fbs under XP Sp3
Image

Mike's equivalent M_FBSL_C.fbs under Wine in elementaryOS Luna (Ubuntu 12.04-based Linux distro)
Image

Mike's equivalent M_FBSL_C.fbs
Code: Select all
Dim MaxIter = 50
Dim XRes As Integer
Dim YRes As Integer
Dim colors[MaxIter]

FbslSetText(ME, "Mandelbrot Benchmark")
Resize(ME, 0, 0, 400, 400)
Center(ME)
Show(ME)

FillColorTable()
Fbsl.GetClientRect(ME, 0, 0, XRes, YRes)

Dim hdc = GetDC(ME)
Dim t = GetTickCount()

GenMandelbrot(-2.1, -1.25, 0.6, 1.25)

MsgBox(, GetTickCount() - t & " ticks", "FBSL",)
ReleaseDC(ME, hdc)

Sub GenMandelbrot(xMn, yMn, xMx, yMx)
   Dim iX, iY, iters
   Dim cx, cy, dx, dy
   
   dx = (xMx - xMn) / (XRes - 1)
   dy = (yMx - yMn) / (YRes - 1)
   
   For iY = 0 To YRes
      cy = yMn + iY * dy
      For iX = 0 To XRes
         cx = xMn + iX * dx
         iters = Iterate(MaxIter, cx, cy)
         If iters = MaxIter Then
            SetPixel(hdc, iX, iY, 0)
         Else
            SetPixel(hdc, iX, iY, colors[iters])
         End If
      Next
      DoEvents
   Next
End Sub

DynC Iterate(%mi, !!cx, !!cy) As Integer
   long main(long MaxIter, double cx, double cy)
   {
      long iters;
      double X = cx, Y = cy, X2 = X * X, Y2 = Y * Y, temp;
      
      while ((iters < MaxIter) && (X2 + Y2 < 4)) {
         temp = cx + X2 - Y2;
         Y = cy + 2 * X * Y;
         Y2 = Y * Y;
         X = temp;
         X2 = X * X;
         iters += 1;
      }
      
      return iters;
   }
End DynC

Sub FillColorTable()
   Dim r, g, b
   Dim rd, gd, bd
   Dim rr, gg, bb
   Dim i, j, wid
   
   Dim clr[3]
   clr[1] = RGB(0, 255, 0)
   clr[2] = RGB(255, 255, 0)
   clr[3] = RGB(255, 0, 0)
   
   wid = MaxIter / 3
   
   For j = 0 To 2
      toRGB(clr[j], r, g, b)
      toRGB(clr[j + 1], rr, gg, bb)
      rd = (rr - r) / (wid + 1)
      gd = (gg - g) / (wid + 1)
      bd = (bb - b) / (wid + 1)
      For i = 0 To wid
         colors[j * wid + i] = RGB(r, g, b)
         r = r + rd
         g = g + gd
         b = b + bd
      Next
   Next
End Sub

Sub toRGB(c, r, g, b)
   r = c BAnd &HFF
   g = (c BAnd &HFF00) / &H100
   b = (c BAnd &HFF0000) / &H10000
End Sub
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Tue Feb 18, 2014 7:01 pm

grrrr :P

Great work, at least we are quite far from AU3
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Tue Feb 18, 2014 10:31 pm

624 ticks :)

Moving also the main "GenMandelbrot" function into JIT Oxygen
Attachments
M_O2_002.zip
(1.45 KiB) Downloaded 123 times
thinBasic_Bench_002.PNG
thinBasic_Bench_002.PNG (89.48 KiB) Viewed 3186 times
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Mike Lobanovsky » Tue Feb 18, 2014 11:24 pm

Eros,

Your Oxygen script runs much better under my XP Sp3 than your Windows 7. (I got a new GSM modem that works through a LAN proxy rather than directly as Mobile Broadband so now I have fewer concurrent processes and faster graphics).

Yet the same FBSL DynC script beats you again.

Eros' O2 JIT script:
Image

Mike's DynC JIT script already posted in this thread:
Image

I'm sorry. There must be something in the air tonight... :)
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Wed Feb 19, 2014 1:28 am

Damn :D

Again great job! :goingmad:
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Thu Feb 20, 2014 12:34 am

Ok, this is my last try, I will not be able to go further.
In this example I avoided to use slow SetPixel but instead I've used a buffered image and put on screen in one go at the end.
Colors are not 100% perfect but you get the idea.

31 ticks

Ciao
Eros
Attachments
M_O2_003.zip
(1.66 KiB) Downloaded 136 times
thinBasic_Bench_003.PNG
thinBasic_Bench_003.PNG (98.04 KiB) Viewed 3169 times
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Mike Lobanovsky » Thu Feb 20, 2014 1:22 am

Hehe, not so fast, Eros! :D

I spent the whole day finally upgrading my station to an Intel i5 3.2GHz Quad as planned long time ago. The speed improvement is terrific; just have a look at the snapshots below.

I confirm that your last script runs at 31 msec on my new machine too so it's propably as fast as we can get with such a crude timing instrument as GetTickCount(). Buffered DynC will probably show the same 31 msec but I'm too tired to code tonight. I'll test it in DynC tomorrow after a good night's sleep.

Eros' non-buffered O2 on Intel i5 Core Quad @3.2GHz:
Image

Mike's non-buffered DynC on Intel i5 Core Quad @3.2GHz:
Image


:gnight:
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Thu Feb 20, 2014 1:56 am

Yes, recent processors are a huge step especially in multitasking area but also in high performances.
You get the difference only if you try it.
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Mike Lobanovsky » Thu Feb 20, 2014 12:17 pm

Aurel,

I would strongly advise you to upgrade your XP to Sp3 as Sp2 is an obsolete ("crappy", in your preferred wording) and unsupported build that lacks a good deal of modern features. There are many ways to do so and at least one of them will suit your needs perfectly. It is also reasonable to keep installing the Sp3 updates that MS still provides thus keeping your OS up to date to its very end. MS doesn't check for the legitimacy of original installations while updating. Do not forget also to keep your video drivers up to date whatever video card you're using. In short, try to tune up your machine as nobody's gonna do it for you except yourself.

When copy-pasting pieces of FBSL code into Eclecta, please make sure there's a trailing blank line that ends the script. Then you won't have problems with the script's last character as reported in your message:

Image

So far it's been your own machine that's been cheating you and noone or nothing else. Serious people don't usually go in for that sort of crap, you know.

Hope this helps.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby Mike Lobanovsky » Fri Feb 21, 2014 4:01 am

Hello Eros,

Sorry to have kept you waiting but I still got a few health problems after my recent flu.

As I already mentioned, your latest script runs at stable 31 msecs on my PC:

Eros' persistent buffered M_O2_003.tbasic:
Image

FBSL doesn't have a predefined persistent drawing canvas facility so I considered the following two possible implementations of it in my effort to defeat your outstanding achievements. :)

The most obvious one was to use conventional blitting from a memory backbuffer. It has one strong advantage - it preserves correct MS Windows colors as it uses standard Windows API's. But it is somewhat slower than your solution (the corresponding script follows the snapshot below):

Mike's persistent WinAPI backbuffer:
Image

M_DC_PERS_SIMPLE_BLIT.fbs:
Code: Select all
Dim MaxIter = 50
Dim XRes As Integer
Dim YRes As Integer
Dim colors[MaxIter] As Integer

FillColorTable()

Resize(ME, 0, 0, 400, 400)
Center(ME)
Fbsl.GetClientRect(ME, 0, 0, XRes, YRes)
FbslSetText(ME, "DynC Mandelbrot Benchmark")

Dim hDC = GetDC(ME)
Dim memDC = CreateCompatibleDC(hDC)
Dim hBmp = SelectObject(memDC, CreateCompatibleBitmap(hDC, XRes, YRes))

Dim ts = GetTickCount(), tf
GenMandelbrot(-2.1, -1.25, 0.6, 1.25)
tf = GetTickCount()

Show(ME)
PostMessage(ME, &HF, 0, 0)

Dim t = SetTimer(ME, &H1000, 100, 0)

Begin Events
   If CBMSG = &H113 Then ' WM_TIMER
      KillTimer(ME, t)
      MsgBox(, tf - ts & " ticks", "FBSL",)
      PostMessage(ME, &H10, 0, 0)
      Return 0
   Else If CBMSG = &HF Then ' WM_PAINT
      ValidateRect(ME, 0)
      BitBlt(hDC, 0, 0, XRes, YRes, memDC, 0, 0, &HCC0020)
      Return 0
   Else If CBMSG = &H10 Then ' WM_CLOSE
      ReleaseDC(ME, hDC)
      DeleteObject(SelectObject(memDC, hBmp))
      DeleteDC(memDC)
   End If
End Events

DynC GenMandelbrot(!!xmn, !!ymn, !!xmx, !!ymx, xr = XRes, yr = YRes, mitr = MaxIter, dc = memDC, clr = @colors[0])
   void __attribute__((stdcall)) SetPixel(int, int, int, int);
   
   int Iterate(double cx, double cy, int MaxIter)
   {
      int iters = 0;
      double X = cx, Y = cy, X2 = X * X, Y2 = Y * Y;
      double temp;
      
      while (iters++ < MaxIter && X2 + Y2 < 4) {
         temp = cx + X2 - Y2;
         Y = cy + 2 * X * Y;
         Y2 = Y * Y;
         X = temp;
         X2 = X * X;
      }
      
      return iters;
   }
   
   void main(double xMn, double yMn, double xMx, double yMx, int XRes, int YRes, int MaxIter, int hDC, int* colors[])
   {
      int iX, iY, iters;
      double cx, cy;
      double dx = (xMx - xMn) / (XRes - 1);
      double dy = (yMx - yMn) / (YRes - 1);
      
      for (iY = 0; iY < YRes; iY++) {
         cy = yMn + iY * dy;
         for (iX = 0; iX < XRes; iX++) {
            cx = xMn + iX * dx;
            iters = Iterate(cx, cy, MaxIter);
            if (iters == MaxIter)
               SetPixel(hDC, iX, iY, 0);
            else
               SetPixel(hDC, iX, iY, (int)colors[iters]);
         }
      }
   }
End DynC

Sub FillColorTable()
   Dim r, g, b
   Dim rd, gd, bd
   Dim rr, gg, bb
   Dim i, j, wid
   
   Dim clr[3]
   clr[1] = RGB(0, 255, 0)
   clr[2] = RGB(255, 255, 0)
   clr[3] = RGB(255, 0, 0)
   
   wid = MaxIter / 3
   
   For j = 0 To 2
      toRGB(clr[j], r, g, b)
      toRGB(clr[j + 1], rr, gg, bb)
      rd = (rr - r) / (wid + 1)
      gd = (gg - g) / (wid + 1)
      bd = (bb - b) / (wid + 1)
      For i = 0 To wid
         colors[j * wid + i] = RGB(r, g, b)
         r = r + rd
         g = g + gd
         b = b + bd
      Next
   Next
End Sub

Sub toRGB(c, r, g, b)
   r = c BAnd &HFF
   g = (c BAnd &HFF00) / &H100
   b = (c BAnd &HFF0000) / &H10000
End Sub


Not quite satisfied with that one, I then used a yet faster method to directly manipulate the DIB pixel buffer similar to how you usually do it in Oxygen-enhanced thinBasic. The drawback of this method is that you have to swap the red and blue values to obtain correct MS Windows colors. But since you didn't try to do that in your sample, I didn't do that in mine either and here's what I've got: :yum:

Mike's DIB bits manipulation:
Image

M_DC_PERS_DIBITS.fbs:
Code: Select all
Dim MaxIter = 50
Dim XRes As Integer
Dim YRes As Integer
Dim colors[MaxIter] As Integer

FillColorTable()

Resize(ME, 0, 0, 400, 400)
Center(ME)
Fbsl.GetClientRect(ME, 0, 0, XRes, YRes)
FbslSetText(ME, "DynC Mandelbrot Benchmark")

Type WORD
   Default %w * 16
End Type

Type BITMAPINFOHEADER Align 2
   biSize As Integer
   biWidth As Integer
   biHeight As Integer
   biPlanes As WORD
   biBitCount As WORD
   biCompression As Integer
   biSizeImage As Integer
   biXPelsPerMeter As Integer
   biYPelsPerMeter As Integer
   biClrUsed As Integer
   biClrImportant As Integer
End Type

Dim bi As BITMAPINFOHEADER

With bi
   .biSize = LenB(BITMAPINFOHEADER)
   .biWidth = XRes
   .biHeight = YRes
   .biPlanes = 1
   .biBitCount = 32
End With

Dim %pixels, hBmp = CreateDIBSection(NULL, @bi, 0, @pixels, NULL, 0)

Dim tf, ts = GetTickCount()
GenMandelbrot(-2.1, -1.25, 0.6, 1.25)
tf = GetTickCount()

Dim hDC = GetDC(ME), memDC = CreateCompatibleDC(NULL)
Dim hOldBmp = SelectObject(memDC, hBmp)

Show(ME)
PostMessage(ME, &HF, 0, 0)

Dim t = SetTimer(ME, &H1000, 100, 0)

Begin Events
   If CBMSG = &H113 Then ' WM_TIMER
      KillTimer(ME, t)
      MsgBox(, tf - ts & " ticks", "FBSL",)
      PostMessage(ME, &H10, 0, 0)
      Return 0
   Else If CBMSG = &HF Then ' WM_PAINT
      ValidateRect(ME, 0)
      BitBlt(hDC, 0, 0, XRes, YRes, memDC, 0, 0, &HCC0020)
      Return 0
   Else If CBMSG = &H10 Then ' WM_CLOSE
      DeleteObject(SelectObject(memDC, hOldBmp))
      DeleteDC(memDC)
      ReleaseDC(ME, hDC)
   End If
End Events

DynC GenMandelbrot(!!xmn, !!ymn, !!xmx, !!ymx, xr = XRes, yr = YRes, mitr = MaxIter, pix = pixels, clr = @colors[0])
   void __attribute__((stdcall)) SetPixel(int, int, int, int);
   
   int Iterate(double cx, double cy, int MaxIter)
   {
      int iters = 0;
      double X = cx, Y = cy, X2 = X * X, Y2 = Y * Y;
      double temp;
      
      while (iters++ < MaxIter && X2 + Y2 < 4) {
         temp = cx + X2 - Y2;
         Y = cy + 2 * X * Y;
         Y2 = Y * Y;
         X = temp;
         X2 = X * X;
      }
      
      return iters;
   }
   
   void main(double xMn, double yMn, double xMx, double yMx, int XRes, int YRes, int MaxIter, int* pixels, int* colors[])
   {
      int* p = pixels;
      int iX, iY, iters;
      double cx, cy;
      double dx = (xMx - xMn) / (XRes - 1);
      double dy = (yMx - yMn) / (YRes - 1);
      
      for (iY = 0; iY < YRes; iY++) {
         cy = yMn + iY * dy;
         for (iX = 0; iX < XRes; iX++) {
            cx = xMn + iX * dx;
            iters = Iterate(cx, cy, MaxIter);
            if (iters != MaxIter)
               *p = (int)colors[iters];
            p += 1;
         }
      }
   }
End DynC

Sub FillColorTable()
   Dim r, g, b
   Dim rd, gd, bd
   Dim rr, gg, bb
   Dim i, j, wid
   
   Dim clr[3]
   clr[1] = RGB(0, 255, 0)
   clr[2] = RGB(255, 255, 0)
   clr[3] = RGB(255, 0, 0)
   
   wid = MaxIter / 3
   
   For j = 0 To 2
      toRGB(clr[j], r, g, b)
      toRGB(clr[j + 1], rr, gg, bb)
      rd = (rr - r) / (wid + 1)
      gd = (gg - g) / (wid + 1)
      bd = (bb - b) / (wid + 1)
      For i = 0 To wid
         colors[j * wid + i] = RGB(r, g, b)
         r = r + rd
         g = g + gd
         b = b + bd
      Next
   Next
End Sub

Sub toRGB(c, r, g, b)
   r = c BAnd &HFF
   g = (c BAnd &HFF00) / &H100
   b = (c BAnd &HFF0000) / &H10000
End Sub


Of course, we can go deeper than that using QueryPerformanceFrequency/Counter() in both thinBasic and FBSL but it would essentially mean to compare not so much thinBasic and FBSL's performance but rather Oxygen and DynC's JIT performance, which is definitely another pair of shoes. Now that I know O2's capabilities in machine code generation pretty deeply, just take my word that DynC's machine code quality is hardly inferior to that of Oxygen.

Anyway, it's been a very intriguing and instructive insight into the capabilities of both languages. Thank you very much for raising the subject once again. I hope you enjoyed it as much as I did. :D

Kind regards,
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby erosolmi » Fri Feb 21, 2014 8:19 am

Thanks a lot Mike.
Same feeling and same pleasure here too.

See you to the next ... benchmark :-)
erosolmi
FBSL tiny seed
FBSL tiny seed
 
Posts: 12
Joined: Tue Mar 21, 2006 12:16 pm

Re: FBSL, thinBasic & AutoIt3 Comparative Benchmarks

Unread postby oleg777 » Tue Nov 25, 2014 1:09 pm

For test of "IntegerBench":
You the above code for VB6 of wrong.

Here is the correct code:
Code: Select all
Attribute VB_Name = "Module1"
Declare Function GetTickCount Lib "kernel32.dll" () As Long

Sub Main()
    Dim n As Long, lim As Long, k As Long, p As Long, pc As Long, gtc As Long
   
    pc = 0
    n = 1
    lim = 5000000
   
    gtc = GetTickCount()
   
    While n < lim
        k = 3
        p = 1
        n = n + 2
        While k * k <= n And p
            p = (n \ k) * k <> n
            k = k + 2
        Wend
        If p Then pc = pc + 1
    Wend
   
    MsgBox pc & " " & (GetTickCount - gtc) / 1000 & " sec VISUALBASIC6"
End Sub


Time on my computer (Core i5-2500):

FBSL [BASIC] - 214 sec
FBSL [DYNASM] - 1.42 sec
FBSL [DYNC] - 1.18 sec
VB6 - 1.34 sec


Also fo test "mandelbench" my result:
FBSL = 3541 ticks
LangMF -> VBScript = 2574 ticks
LangMF -> Chakra (Javascript in IE11) = 858 ticks
LangMF -> Chakra (fast setpixel) - 140 ticks
oleg777
FBSL tiny seed
FBSL tiny seed
 
Posts: 1
Joined: Tue Nov 25, 2014 12:59 pm

PreviousNext

Return to FBSL v3 News

Who is online

Users browsing this forum: No registered users and 1 guest

cron