Re: Weird performance issue

2022-09-23 Thread Geoff Canyon via use-livecode
On Fri, Sep 23, 2022 at 4:44 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Letting the engine do it for you is always faster.
>

Interestingly, *just* getting the names and ids for a 1500 card stack is
only about 15 times faster using the functions rather than a loop that gets
each individually.

For my purposes I have to parse the results anyway, which reduces the ratio
to about 6 times faster. Enough that I'll definitely rewrite the code, but
less than I would have expected.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Geoff Canyon via use-livecode
Yep, I'm aware of cardnames. I don't have any memory of why I wrote it this
way -- maybe I didn't trust the ordering of cardnames and cardids? Or maybe
it made more sense to collect by hand than to stitch together the values?
Or maybe I just sucked at that moment in time.

gc

On Fri, Sep 23, 2022 at 4:44 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Are you familiar with the cardnames function? Letting the engine do it for
> you is always faster. That doesn't answer your question though.
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On September 23, 2022 5:46:24 PM Geoff Canyon via use-livecode
>  wrote:
>
> > On Fri, Sep 23, 2022 at 11:08 AM Mark Wieder via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> On 9/23/22 10:40, J. Landman Gay via use-livecode wrote:
> >> > It may be related to the size of the stack. LC would have to load it
> all
> >> > into memory before checking the cards. Also, do the results change if
> >> > you lock messages?
> >>
> >> You also do a *lot* of work on both opening the stack and opening the
> >> card. And looping through that many times in your test. Your loop test
> >> doesn't really simulate real-world conditions for Navigator, so I don't
> >> think I'd worry about it too much.
> >>
> >> --
> >>   Mark Wieder
> >>   ahsoftw...@gmail.com
> >
> >
> > Why would the stack be opened, or the card, just checking existence? And
> > why would that happen each time rather than once?
> >
> > FYI for all tests the stacks are already open.
> >
> > And: Navigator until the version I'm working on now did exactly this when
> > getting a list of the card names I have no idea why I coded it that way,
> > but checking that method vs. getting the number of cards and then getting
> > the names based on that was what let me to notice this.
> >
> > thanks!
> >
> > gc
> > ___
> > use-livecode mailing list
> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread J. Landman Gay via use-livecode
Are you familiar with the cardnames function? Letting the engine do it for 
you is always faster. That doesn't answer your question though.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On September 23, 2022 5:46:24 PM Geoff Canyon via use-livecode 
 wrote:



On Fri, Sep 23, 2022 at 11:08 AM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:


On 9/23/22 10:40, J. Landman Gay via use-livecode wrote:
> It may be related to the size of the stack. LC would have to load it all
> into memory before checking the cards. Also, do the results change if
> you lock messages?

You also do a *lot* of work on both opening the stack and opening the
card. And looping through that many times in your test. Your loop test
doesn't really simulate real-world conditions for Navigator, so I don't
think I'd worry about it too much.

--
  Mark Wieder
  ahsoftw...@gmail.com



Why would the stack be opened, or the card, just checking existence? And
why would that happen each time rather than once?

FYI for all tests the stacks are already open.

And: Navigator until the version I'm working on now did exactly this when
getting a list of the card names I have no idea why I coded it that way,
but checking that method vs. getting the number of cards and then getting
the names based on that was what let me to notice this.

thanks!

gc
___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Geoff Canyon via use-livecode
On Fri, Sep 23, 2022 at 11:08 AM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 9/23/22 10:40, J. Landman Gay via use-livecode wrote:
> > It may be related to the size of the stack. LC would have to load it all
> > into memory before checking the cards. Also, do the results change if
> > you lock messages?
>
> You also do a *lot* of work on both opening the stack and opening the
> card. And looping through that many times in your test. Your loop test
> doesn't really simulate real-world conditions for Navigator, so I don't
> think I'd worry about it too much.
>
> --
>   Mark Wieder
>   ahsoftw...@gmail.com


Why would the stack be opened, or the card, just checking existence? And
why would that happen each time rather than once?

FYI for all tests the stacks are already open.

And: Navigator until the version I'm working on now did exactly this when
getting a list of the card names I have no idea why I coded it that way,
but checking that method vs. getting the number of cards and then getting
the names based on that was what let me to notice this.

thanks!

gc
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Geoff Canyon via use-livecode
My test stack had over a thousand cards in it, and was still fast checking
the 1000th card.

I've now added a field to each of a thousand cards and stuck text in it;
the stack is over 12MB and still much faster than Navigator, which is under
1MB.

Lock Messages does nothing as far as I can tell.

thanks!

gc

On Fri, Sep 23, 2022 at 10:41 AM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> It may be related to the size of the stack. LC would have to load it all
> into memory before checking the cards. Also, do the results change if you
> lock messages?
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On September 22, 2022 3:01:48 PM Geoff Canyon via use-livecode
>  wrote:
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Mark Wieder via use-livecode

On 9/23/22 10:40, J. Landman Gay via use-livecode wrote:
It may be related to the size of the stack. LC would have to load it all 
into memory before checking the cards. Also, do the results change if 
you lock messages?


You also do a *lot* of work on both opening the stack and opening the 
card. And looping through that many times in your test. Your loop test 
doesn't really simulate real-world conditions for Navigator, so I don't 
think I'd worry about it too much.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread J. Landman Gay via use-livecode
It may be related to the size of the stack. LC would have to load it all 
into memory before checking the cards. Also, do the results change if you 
lock messages?

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On September 22, 2022 3:01:48 PM Geoff Canyon via use-livecode 
 wrote:



I was testing something for Navigator and found the following:

put the long seconds into T
repeat 1
 get there is a card 1 of stack "untitled 1"
 --get there is a card 1 of stack "revnavigator"
end repeat
put the long seconds - T into T
put T
-- puts 0.005 or so

put the long seconds into T
repeat 1
 --get there is a card 1 of stack "untitled 1"
 get there is a card 1 of stack "revnavigator"
end repeat
put the long seconds - T into T
put T
-- puts 1.2

Why in the world would it take over 200x as long to identify that there is
a card 1 of Navigator vs. a random stack I just created?

I just checked and:
stack "message" -- over 3 seconds -- a second run was 0.4
stack "revdictionary" -- 1.5 seconds
stack "home" -- 0.02 seconds

I ran it across everything in the environment and got results from under a
hundredth of a second to over a second, with stacks pretty smoothly across
that range. No clue what's causing it.
___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Geoff Canyon via use-livecode
Hmm, this is what "the stacks" returns for me:

/Users/gcanyon/Desktop/nav tester 0.004608

/Applications/LiveCode
9.6.8.app/Contents/Tools/Toolset/palettes/script-editor/revscripteditor.rev
0.272558

/Applications/LiveCode
9.6.8.app/Contents/Tools/Toolset/palettes/tools-palette/revtools.livecodescript
0.440798

/Applications/LiveCode
9.6.8.app/Contents/Tools/Toolset/palettes/dictionary/revdictionary.livecode
1.72743

/Applications/LiveCode
9.6.8.app/Contents/Tools/Toolset/palettes/menubar/revmenubar.livecodescript
0.421698

/Users/gcanyon/Desktop/nav tester 0.00453

0.007308

/Applications/LiveCode
9.6.8.app/Contents/Tools/Toolset/palettes/inspector/revinspector.livecodescript
1.565991

/Users/gcanyon/Documents/My LiveCode/Plugins/Navigator.rev 1.348666

Note the super long times for the dictionary, the inspector, and navigator,
the mediocre times for others, and the super fast time for the stack
actually running the code.

I'm on an M1 mac running 9.6.8



On Fri, Sep 23, 2022 at 6:48 AM Craig Newman via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Something weird happened to my post.
>
> I modified your handler to access only those stacks that appear when
> calling the function “the stacks”. In all those cases, the return time was
> only a few tenths of a second.
>
> But “revNaviigator” does not appear on that list. So there must be a
> longer pathway for LC to find a stack that certainly must be in memory, but
> that does not appear in the “stacks” list?
>
> Craig
>
> > On Sep 22, 2022, at 3:58 PM, Geoff Canyon via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I was testing something for Navigator and found the following:
> >
> > put the long seconds into T
> > repeat 1
> >  get there is a card 1 of stack "untitled 1"
> >  --get there is a card 1 of stack "revnavigator"
> > end repeat
> > put the long seconds - T into T
> > put T
> > -- puts 0.005 or so
> >
> > put the long seconds into T
> > repeat 1
> >  --get there is a card 1 of stack "untitled 1"
> >  get there is a card 1 of stack "revnavigator"
> > end repeat
> > put the long seconds - T into T
> > put T
> > -- puts 1.2
> >
> > Why in the world would it take over 200x as long to identify that there
> is
> > a card 1 of Navigator vs. a random stack I just created?
> >
> > I just checked and:
> > stack "message" -- over 3 seconds -- a second run was 0.4
> > stack "revdictionary" -- 1.5 seconds
> > stack "home" -- 0.02 seconds
> >
> > I ran it across everything in the environment and got results from under
> a
> > hundredth of a second to over a second, with stacks pretty smoothly
> across
> > that range. No clue what's causing it.
> > ___
> > use-livecode mailing list
> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Craig Newman via use-livecode
Something weird happened to my post.

I modified your handler to access only those stacks that appear when calling 
the function “the stacks”. In all those cases, the return time was only a few 
tenths of a second.

But “revNaviigator” does not appear on that list. So there must be a longer 
pathway for LC to find a stack that certainly must be in memory, but that does 
not appear in the “stacks” list?

Craig

> On Sep 22, 2022, at 3:58 PM, Geoff Canyon via use-livecode 
>  wrote:
> 
> I was testing something for Navigator and found the following:
> 
> put the long seconds into T
> repeat 1
>  get there is a card 1 of stack "untitled 1"
>  --get there is a card 1 of stack "revnavigator"
> end repeat
> put the long seconds - T into T
> put T
> -- puts 0.005 or so
> 
> put the long seconds into T
> repeat 1
>  --get there is a card 1 of stack "untitled 1"
>  get there is a card 1 of stack "revnavigator"
> end repeat
> put the long seconds - T into T
> put T
> -- puts 1.2
> 
> Why in the world would it take over 200x as long to identify that there is
> a card 1 of Navigator vs. a random stack I just created?
> 
> I just checked and:
> stack "message" -- over 3 seconds -- a second run was 0.4
> stack "revdictionary" -- 1.5 seconds
> stack "home" -- 0.02 seconds
> 
> I ran it across everything in the environment and got results from under a
> hundredth of a second to over a second, with stacks pretty smoothly across
> that range. No clue what's causing it.
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weird performance issue

2022-09-23 Thread Craig Newman via use-livecode
Geoff.

I get over 5 seconds for the “revNavigatior”

So I modified your handler just a bit, to only a

But “revNaviigator” does not appear on that list. So there must be a longer 
pathway for LC to find a stack that certainly must be in memory, but that does 
not appear in the “stacks” list?

Craig

> On Sep 22, 2022, at 3:58 PM, Geoff Canyon via use-livecode 
>  wrote:
> 
> put the long seconds into T
> repeat 1
>  get there is a card 1 of stack "untitled 1"
>  --get there is a card 1 of stack "revnavigator"
> end repeat
> put the long seconds - T into T
> put T
> -- puts 0.005 or so
> 
> put the long seconds into T
> repeat 1
>  --get there is a card 1 of stack "untitled 1"
>  get there is a card 1 of stack "revnavigator"
> end repeat
> put the long seconds - T into T
> put T
> -- puts 1.2

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Weird performance issue

2022-09-22 Thread Geoff Canyon via use-livecode
I was testing something for Navigator and found the following:

put the long seconds into T
repeat 1
  get there is a card 1 of stack "untitled 1"
  --get there is a card 1 of stack "revnavigator"
end repeat
put the long seconds - T into T
put T
-- puts 0.005 or so

put the long seconds into T
repeat 1
  --get there is a card 1 of stack "untitled 1"
  get there is a card 1 of stack "revnavigator"
end repeat
put the long seconds - T into T
put T
-- puts 1.2

Why in the world would it take over 200x as long to identify that there is
a card 1 of Navigator vs. a random stack I just created?

I just checked and:
stack "message" -- over 3 seconds -- a second run was 0.4
stack "revdictionary" -- 1.5 seconds
stack "home" -- 0.02 seconds

I ran it across everything in the environment and got results from under a
hundredth of a second to over a second, with stacks pretty smoothly across
that range. No clue what's causing it.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode