Sort IP List

Ralph DiMola rdimola at evergreeninfo.net
Sun Jul 1 02:37:15 CEST 2018


How fortuitous... I am finding the bottlenecks in some code under a deadline
the last few days and found some interesting observations.

1) Assembling, putting data into a field and doing text editing (replace x
with y in fld F1) in an non-visible field object is faster than assembling a
line in a local var and then putting it into the field once. I understand
that I'm moving the data twice but I thought there was some overhead of
field formatting every time I changed the data. apparently not...

I had a function call in a loop with two params and it returned a text
string of a few hundred to a few thousand cars. I changed it to a handler
with three params all by ref(the third being the var that the function
version set. Now I would have though the with everything by ref it would be
faster but in fact it was slower by 50%.

LC makes it so easy to do timings. I actually had fun tracking down and
attacking each bottleneck. Some stuff like putting simple calculations
in-line repeat constructs speeded things up as expected, others befuddled
me.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of Tom Glod via use-livecode
Sent: Saturday, June 30, 2018 3:51 PM
To: How to use LiveCode
Cc: Tom Glod
Subject: Re: Sort IP List

good thread you guys...code optimization quests....what fun.

On Sat, Jun 30, 2018 at 2:01 PM, Niggemann, Bernd via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Hermann,
>
> I did not see Alex's solution until after I posted. I agree that 
> inline is probably always faster.
>
> And after I saw Alex's post I would not have thought that one could do 
> it that way, thanks Alex. On top it is by far the fastest.
>
> On the other hand sort by myFunction(each) is so powerful that you can 
> do things that are probably not possible inline.
>
> Kind regards
> Bernd
>
>
>
>
> hh via use-livecode<https://www.mail-archive.com/search?l=use-
> livecode at lists.runrev.com&q=from:%22hh+via+use%5C-livecode%22> Sat, 30 
> Jun 2018 03:12:55 -0700<https://www.mail-archive.com/search?l=use-
> livecode at lists.runrev.com&q=date:20180630> wrote:
>
>
> @Bernd
> Depending on the function an inline computation (as Alex denoted) may 
> be even faster than the private function calls?
> Here, with IPv4 addresses, it is faster.
>
> _______________________________________________
> 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
>
_______________________________________________
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