I have written a plugin to do a function which need to get a array of some specified layers at first. I usually run this function many times constantly in a few seconds. The problem is that each time I run this simple function it will get the array which actually hardly ever change in these seconds. It makes the process really slow. So i want the script to keep this array and don't clear it after I run this function once unless it triggers something i have already set.
Is there any way to solve this problem? Appreciation.