the "price" of a context switch/function call

dunbarx at aol.com dunbarx at aol.com
Sat Oct 4 17:38:50 EDT 2014


Hi..
Write a test handler that loops a function call and another that implements the same functionality in line.


The working code can be anything simple. Loop thousands of times. Write back.


Craig Newman



-----Original Message-----
From: Dr. Hawkins <dochawk at gmail.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Sat, Oct 4, 2014 1:55 pm
Subject: the "price" of a context switch/function call


I'm eternally conflicted between the needed frugality of my eight bit
childhood and the desire for clean code . . .

And I never forget the model I wrote in smalltalk with nice "proper"
 OO message passing (the messages I was modeling, in fact), and then
rewrote line for line in Fortran without optimizing--a 45,000 to one
speedup.

Anyway, today's conflicted question is on function calls, and how much it
"costs" to make a function call in livecode.

If I'm going to call a routine, say, 100 times in a fraction of a second,
do I really save much by inlining it rather than calling it as a function?

-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list