Speedy LiveCode

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Speedy LiveCode

Post by dunbarx » Thu Sep 20, 2018 11:31 pm

I have not changed my machine in years, and am using v. 8. on a 3.2 GHz iMac in OS 10.13

A handler like the following:

Code: Select all

on mouseup
   put the ticks into temp
   put "4" into foo
   repeat 10000000 --ten million
    add 4 to foo  --79 ticks
    -- get random(999) --86 ticks
    --  put 4 +  6 into foo -- 118 ticks
   end repeat
   answer the ticks - temp
end mouseup
Takes 79 ticks, or about 7.6 million passes through the repeat loop per second. The other operations are only a little slower.

This is well over twice as fast as benchmarks I made years ago, in v.6. Good news, and in RAM only, so am I noticing anything important?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Speedy LiveCode

Post by richmond62 » Fri Sep 21, 2018 8:33 am

120 ticks over "here" on a piece of junk I got for nothing:

Xubuntu 18.04

Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz
Dual Core
8 GB RAM
computer_slap-large-seal.jpg
computer_slap-large-seal.jpg (34 KiB) Viewed 7070 times
nothing as in "This lump of something has been sitting around
for donkey's ages in my shop and nobody wants it, so do me a favour . . ."

I'll never complain about the speed of LiveCode beyond the occasional "That's too fast for me." 8)
Last edited by richmond62 on Fri Sep 21, 2018 8:43 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Speedy LiveCode

Post by richmond62 » Fri Sep 21, 2018 8:38 am

168 ticks on my 2006 iMac:

Mac OS 10.7.5 (Lion).
2.16 GHz Intel Core Duo
3 GB RAM
sleepyLion.jpg
sleepyLion.jpg (12.59 KiB) Viewed 7071 times
Certainly a lot faster than my ability to gulp coffee!

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

Re: Speedy LiveCode

Post by AxWald » Fri Sep 21, 2018 11:03 am

Hi,
dunbarx wrote:
Thu Sep 20, 2018 11:31 pm
This is well over twice as fast as benchmarks I made years ago, in v.6. Good news, and in RAM only, so am I noticing anything important?
Twice as fast as in LC 6? Sure you don't have any quirks in your data?

I tried it on my cheap (€ 50 as leasing return) dev machine (HP Compaq 6005 pro, built 2010, Athlon II X2 B24 @ 3GHz, 8GB RAM, Win 10-64 pro v1803), using my reference LC versions and each of the 3 options in your code:

Code: Select all

LC/ Task:	6.5	6.7.10	7.1.4	8.1.8	9.0.1
-----------------------------------------------------
"add 4":	50	41	88	128	135
"random":	78	75	100	145	174
"4 + 6":	116	80	111	188	224
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!

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Speedy LiveCode

Post by Klaus » Fri Sep 21, 2018 12:52 pm

MacMini (late 2014), 8 GB RAM, 2.6 GHZ i5, macOS 10.3.6, LC 9.0.1:

Code: Select all

-----------------------------------------------------
Ticks:
"add 4":	73
"random":	77
"4 + 6":	116
-----------------------------------------------------
Milliseconds
"add 4":	1211
"random":	1270
"4 + 6":	1939
-----------------------------------------------------

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Speedy LiveCode

Post by bogs » Fri Sep 21, 2018 8:10 pm

I took your code, and put it into a little stack for testing, starting with Mc 2.5 starter kit :D
livecodeide_speedtester_McStarterKit25.zip
Made in Mc2.5 starter... Modified vers.
(1.02 KiB) Downloaded 194 times
This box is running LMDE2 18.1, 4 gigs ram, and a 3 core amd cpu. All of the tests were run with the following system resources left before opening the various IDEs -
Selection_016.png
Conky...
I moved up through the IDEs from Mc pre-oss to Lc 8.1.2 on this machine. On to the tests...
Image...Image...Image...Image...Image...Image...Image...Image...Image

*Edit - just setup a vm to test 9.0.1 on debian testing, so grabbed that test as well -
Selection_017.png
Lc9.0.1 test...
*Edit 2 - just realized I should probably have mentioned all the results were testing only the add to foo line as the base :oops:

Edit 3 - Modified it a bit -
Image
Image

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Speedy LiveCode

Post by Klaus » Sat Sep 22, 2018 2:37 pm

And here is MC with engine 5.5.4, the latest version I maintained as the MC poobah. :-)
speedy_mc.jpg

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Speedy LiveCode

Post by bogs » Sat Sep 22, 2018 2:51 pm

Thanks for running it Klaus, I don't have any 5.x series to test with :D
Image

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm
Location: Blenheim, New Zealand

Re: Speedy LiveCode

Post by paul_gr » Sat Sep 22, 2018 8:25 pm

I'm still using LC 5.5.5 for general use in Windows 10.
System is Intel i7-8700k, 16Gb ram running Windows 10 64bit.

Dunbarx's code snippet in LC 5.5.5 takes 15 ticks.

Using bogs MC stack.
Speedy LIveCode.png
Paul

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Speedy LiveCode

Post by bogs » Sun Sep 23, 2018 12:52 pm

Running this on 'nix sure makes the older IDEs look speedy as heck.
6.5.2 vs. 8.1.2 -
Selection_012.png
6.5.2...
Selection_013.png
8.1.2...
@paul_gr -
Holy cats :shock:
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Speedy LiveCode

Post by richmond62 » Sun Sep 23, 2018 4:25 pm

The Transcript engine you are running
isn't that just a bit . . . ?

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Speedy LiveCode

Post by bogs » Sun Sep 23, 2018 4:41 pm

Think I should change it to "The X-talk engine you are running.." ? :D

I made it a standalone in 6.5 and 7.1, to see if there was any differences to note.
Speedy LIveCode_015.png
No IDE 6.5.2...
Speedy LIveCode_016.png
No IDE 7.1.4...
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Speedy LiveCode

Post by richmond62 » Sun Sep 23, 2018 6:09 pm

Art imitates life: a slow decline:
LC7.png
LC8.png
LC9.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Speedy LiveCode

Post by richmond62 » Sun Sep 23, 2018 6:56 pm

And here are the standalone results (Xubuntu 64-bit, 18.04):
standAlone7.png
LC 8.1.10
LC8.1.10.png
LC 9.0.1
LC9.0.1.png

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Speedy LiveCode

Post by bogs » Sun Sep 23, 2018 7:17 pm

Yah, I saw that problem too Richmond. Beyond 8.0 (I think) you need to save the file in the current Lc IDE format before compiling it. To boot, you may have to compile it with 'nix64 and not 32, or you might get a shared library error.

v9 standalone (Debian Vm)
Selection_017.png
v9 64bit standalone...
*Edit - to get the v9 compiled 32bit 'nix version to run, your system needs to be setup for multi-arch (see debian multi-arch if your debian based), and from the command line you need to enter -

Code: Select all

sudo apt update
sudo apt-get install libgtk2.0-0:i386
Here is the 32 bit version of the compiled v9 standalone -
Selection_018.png
v9 32bit standalone...
Image

Post Reply

Return to “Talking LiveCode”