Livecode Server performance

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: Livecode Server performance

Post by AxWald » Thu Apr 29, 2021 6:00 pm

Hi,

Ooops, didn't explain it clearly enough - I only used the "$_SERVER['REMOTE_ADDR']" this time. So the results basically show what's the cost for a very simple CGI call, over the different versions & tools.

Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Livecode Server performance

Post by FourthWorld » Thu Apr 29, 2021 6:09 pm

What is the complete script?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: Livecode Server performance

Post by AxWald » Fri Apr 30, 2021 1:34 pm

Hi,
FourthWorld wrote:
Thu Apr 29, 2021 6:09 pm
What is the complete script?
I used "put $_SERVER["REMOTE_ADDR"]" (LC) resp. "echo $_SERVER['REMOTE_ADDR'];" (PHP) for my test.
FourthWorld wrote:
Thu Apr 29, 2021 4:54 pm
[...] it may be helpful to run the test I noted above in the IDE to get a better feel for what that particular test is - and isn't - showing us.
You mean this one?

Code: Select all

   put 0 into myVar
   repeat for 100 times
      add 1 to myVar
      put myVar
   end repeat
Looking closer, this test doesn't make sense. It would just flood stdOut with a hundred lines, right? Maybe this is what confuses loader.io?

I translated it to:

Code: Select all

<?lc
put 0 into myVar
repeat 100
add 1 to myVar
end repeat
put myVar
?>

<?php
$myVar=0;
while($myVar < 100) {
$myVar ++;
}
echo $myVar;
?>
Tested with my improved tool (see below!) I got these results:

Code: Select all

Web site tiny:	49.8 ms	1/ a
addUp PHP 7.2:	50.7 ms	3/ 100
Web site:	50.9 ms	1666/ <!DOCTYPE [...]
addUp PHP 8:	51 ms	3/ 100
addUp LC 8.2:	79.4 ms	3/ 100
addUp LC 8.0:	89.4 ms	3/ 100
Explanation: "addUp" are the scripts above. "Web site" are two .html's fetched. 3rd row shows "[Size of result]/ line 1 of [result]" - the real HTML doc is trunctated here. The times are for 1 call (averaged).

Interesting:
- This is something where PHP 7.2 is fast - usually it's considerable slower compared to PHP 8!
- The PHP's & the web sites are always very close, so PHP seems to have nearly zero overhead.
- The LC servers always are min. ~30ms slower. (Only 'revdb.so' & 'dbmysql.so', anything else is removed).

Ah, and there's a new version of my tester tool:
- It now performs an additional (invisible) test on the local HD, reading a tiny file. To compensate for any slow hardware/ LC versions this time is subtracted from each of the other results. If this happens, the result contains a notice. My LC 6.7.10 does it reliable in ways below 1 ms, so I never get the msg :)
- It now allows any results - it drops all but line 1 & removes any quotes from it. So you can fetch complete web sites or more complex results. This caused a crash before.
- It now shows the (real) size of the scripts results, before the actual result.

Have fun!
Attachments
awaCGITest11.zip
An improved version of the CGI timer
(9.27 KiB) Downloaded 201 times
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Livecode Server performance

Post by FourthWorld » Fri Apr 30, 2021 4:00 pm

I'll share my php notes later when I'm at my desk.

So far in your shared host tests we see a difference of 0.03 seconds - measurable but not noticeable.

Have you done any comparisons with Ruby or Python?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Livecode Server performance

Post by FourthWorld » Fri Apr 30, 2021 4:07 pm

Rereading your post, that test was done on localhost, not a shared server?

Is php being run via CGI, FastCGI, or Apache Module?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: Livecode Server performance

Post by AxWald » Fri Apr 30, 2021 8:54 pm

Hi,

all tests was done on the same shared server @ All-Inkl.com. My own local Ubuntu server has been retired - getting CGI to work in my available time was too difficult a task. Seems if you read 3 specific Linux how-to's you learn 4 different "solutions", and quite often none of it applies ;-)

As far as I know, my PHP runs as "CGI/FPM" - whatever this is. Is there a way to find out via SSH?

And no, no tests with Ruby or Python. I'd not even know how to do it ;-)

Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

Post Reply

Return to “CGIs and the Server”