Start using stack - Loading stack libraries

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Start using stack - Loading stack libraries

Knapp Martin via use-livecode
Hi All,

I am currently using library stacks that contain what I call custom builders, that are livecode script libraries. These stacks have code for specific instances and when done, I currently unload them. I like that I can use these, and build them, on the fly, bringing that code in without having to “disturb” the main app.

As I’m about to start loading and unloading them hundreds if not thousands of times, and very rapidly, I started thinking about how this would effect performance, memory issues, etc.

Does anyone have experience doing this and doing it rapidly? Anyone come across any memory issues, leakage, etc.? Anything else I should look for in doing this? Different ways to accomplish the same thing?

Any insight is appreciated!

Thanks,

Steve MacLean

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Start using stack - Loading stack libraries

Knapp Martin via use-livecode
My main thought is if we are talking about loading and unloading thousands of times then script parsing may become costly. How costly I’m not sure… script parsing is pretty fast.

> On 6 Aug 2018, at 10:51 am, Stephen MacLean via use-livecode <[hidden email]> wrote:
>
> Hi All,
>
> I am currently using library stacks that contain what I call custom builders, that are livecode script libraries. These stacks have code for specific instances and when done, I currently unload them. I like that I can use these, and build them, on the fly, bringing that code in without having to “disturb” the main app.
>
> As I’m about to start loading and unloading them hundreds if not thousands of times, and very rapidly, I started thinking about how this would effect performance, memory issues, etc.
>
> Does anyone have experience doing this and doing it rapidly? Anyone come across any memory issues, leakage, etc.? Anything else I should look for in doing this? Different ways to accomplish the same thing?
>
> Any insight is appreciated!
>
> Thanks,
>
> Steve MacLean
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Start using stack - Loading stack libraries

Knapp Martin via use-livecode
In reply to this post by Knapp Martin via use-livecode
On 8/5/2018 8:51 PM, Stephen MacLean via use-livecode wrote:
> Any insight is appreciated!
>

I use a lot of library stacks, but our model is to load them on startup
and unload on shutdown (not really necessary singe the engine does this
on quit). Unless you have zillions of lines of code, I am not sure what
the value is of unloading and reloading the same library?

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Start using stack - Loading stack libraries

Knapp Martin via use-livecode
Hi Paul and Monte,

Thanks for the input!

@ Monte, I might be able to order the initial query so that they are grouped together by builder type. Then I could process those together with doing one load and unload for that group

@ Paul, they are different, based upon the type of build that needs to happen for the source that is being looked at. The code has one handler name that is the same (The init code in the builder), but after that the code is different.

All input welcome:)

Thanks,

Steve

> On Aug 5, 2018, at 9:21 PM, Paul Dupuis via use-livecode <[hidden email]> wrote:
>
> On 8/5/2018 8:51 PM, Stephen MacLean via use-livecode wrote:
>> Any insight is appreciated!
>>
>
> I use a lot of library stacks, but our model is to load them on startup
> and unload on shutdown (not really necessary singe the engine does this
> on quit). Unless you have zillions of lines of code, I am not sure what
> the value is of unloading and reloading the same library?
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Start using stack - Loading stack libraries

Knapp Martin via use-livecode
On 8/5/2018 11:29 PM, Stephen MacLean via use-livecode wrote:
> @ Paul, they are different, based upon the type of build that needs to happen for the source that is being looked at. The code has one handler name that is the same (The init code in the builder), but after that the code is different.

Some where, you have a conditional or switch statements to decide what
library to load based on the "source". File I/O is always slower than
most anything else in a computer these days. So if you load all the
libraries and use the switch/if/etc. to just change what library
routines are called based on the "source" rather than change what is
read from disk, you will reduce any (if there are any) memory leaks
issues and speed up your work. It's up to you as I, of course, have no
idea what your code looks like or even what you're doing.

I get the impression that each library has many routines that have the
same name (as in other libraries) but do different things. It may be
more effort that any performance gain is worth to have to rename all
those routines and adjust code so they can be all loaded at once.

Ultimately, the best way to determine if your approach to loading and
unloading libraries in volume is to construct a quality assurance test -
get or generate a while pile of "sources" and run them through on a test
system and see what happens.



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Start using stack - Loading stack libraries

Knapp Martin via use-livecode

> On Aug 6, 2018, at 8:05 AM, Paul Dupuis via use-livecode <[hidden email]> wrote:
>
> On 8/5/2018 11:29 PM, Stephen MacLean via use-livecode wrote:
>> @ Paul, they are different, based upon the type of build that needs to happen for the source that is being looked at. The code has one handler name that is the same (The init code in the builder), but after that the code is different.
>
> Some where, you have a conditional or switch statements to decide what
> library to load based on the "source". File I/O is always slower than
> most anything else in a computer these days. So if you load all the
> libraries and use the switch/if/etc. to just change what library
> routines are called based on the "source" rather than change what is
> read from disk, you will reduce any (if there are any) memory leaks
> issues and speed up your work. It's up to you as I, of course, have no
> idea what your code looks like or even what you're doing.
>
> I get the impression that each library has many routines that have the
> same name (as in other libraries) but do different things. It may be
> more effort that any performance gain is worth to have to rename all
> those routines and adjust code so they can be all loaded at once.

You are correct, same name, but do different things. Each has routines that are self-contained, and only rely on core functions that are at the main stack level.

I’ve read that there is something like a 50 stack limit that can be loaded at one time, which is why I initially went this way. Do you know if that is still the case?

>
> Ultimately, the best way to determine if your approach to loading and
> unloading libraries in volume is to construct a quality assurance test -
> get or generate a while pile of "sources" and run them through on a test
> system and see what happens.
>


In this process now and hoping to see good results with the way it is, but always looking to improve.

Thx!

Steve



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Start using stack - Loading stack libraries

Knapp Martin via use-livecode
On my IDE, mainstacks is currently 204. The stacks are stored in a linked list, so no limit other than memory and performance.

Thanks,
Brian
On Aug 6, 2018, 7:14 AM -0500, Stephen MacLean via use-livecode <[hidden email]>, wrote:

>
> > On Aug 6, 2018, at 8:05 AM, Paul Dupuis via use-livecode <[hidden email]> wrote:
> >
> > On 8/5/2018 11:29 PM, Stephen MacLean via use-livecode wrote:
> > > @ Paul, they are different, based upon the type of build that needs to happen for the source that is being looked at. The code has one handler name that is the same (The init code in the builder), but after that the code is different.
> >
> > Some where, you have a conditional or switch statements to decide what
> > library to load based on the "source". File I/O is always slower than
> > most anything else in a computer these days. So if you load all the
> > libraries and use the switch/if/etc. to just change what library
> > routines are called based on the "source" rather than change what is
> > read from disk, you will reduce any (if there are any) memory leaks
> > issues and speed up your work. It's up to you as I, of course, have no
> > idea what your code looks like or even what you're doing.
> >
> > I get the impression that each library has many routines that have the
> > same name (as in other libraries) but do different things. It may be
> > more effort that any performance gain is worth to have to rename all
> > those routines and adjust code so they can be all loaded at once.
>
> You are correct, same name, but do different things. Each has routines that are self-contained, and only rely on core functions that are at the main stack level.
>
> I’ve read that there is something like a 50 stack limit that can be loaded at one time, which is why I initially went this way. Do you know if that is still the case?
>
> >
> > Ultimately, the best way to determine if your approach to loading and
> > unloading libraries in volume is to construct a quality assurance test -
> > get or generate a while pile of "sources" and run them through on a test
> > system and see what happens.
> >
>
>
> In this process now and hoping to see good results with the way it is, but always looking to improve.
>
> Thx!
>
> Steve
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode