Page 1 of 1

Slow swapping from card to card[found reason]

Posted: Wed Aug 19, 2015 12:40 pm
by hilton
livecode versions: 7.0.5 & 7.0.6

Hi Folks,

I seem to constantly run into speed problems with lc in the windows environment. As my app grows so the speed decreases. I have 15 cards 6 of which are libraries of functions and things like a calendar picker and time picker and behaviours. From a user perspective there are 9 cards to navigate around. During development in the IDE going from card to card takes 7 seconds.

I have timed the change by having 2 global variables, one I put in the "closecard" handler where I record the long time of departure and the other I put at the beginning of the "preopencard" handler and record the long time of arrival. In so doing I hope I have avoided my code which may well be inefficient.

I have created a standalone in windows of the above app. The time taken to move from card to card is 4 seconds. Interestingly, going from card to card on my Android phone is generally less than one second - one second at the outside.

The app has been written with a view to using it in the Windows and Android environments. In this regard the language is very accommodating, however, the speed in Windows means that I cannot use it in that environment and if that were the case it would be somewhat disappointing.

It seems to me that speeding up the time between the closecard and preopencard handler is beyond my control - that may be a bit naive. Can anyone shed some light on how I may reduce this time please.

Thank you,
Hilton.

Re: Slow swapping from card to card

Posted: Wed Aug 19, 2015 12:46 pm
by Klaus
Hi Hilton,

without looking at your code we can only guess, and that is ineffective.


Best

Klaus

Re: Slow swapping from card to card

Posted: Wed Aug 19, 2015 5:09 pm
by dunbarx
Something is wrong. Unless navigation is calling all sorts of resources and processing a whole lot of data, and I mean a whole lot, card transitions should be instantaneous.

So what Klaus said. We need to see what happens in the handlers that fire when you change cards

Craig Newman

Re: Slow swapping from card to card[found reason]

Posted: Thu Aug 20, 2015 12:01 am
by hilton
Hi folks,

I have found out what the problem is but not the cause. Funny how things happen - I was fast asleep last night when the answer came to me. I remembered I had this problem once before plus some corruption problems with the early versions of version 7. I also remembered the work around.

I keep 5 generations of backup of this app on my computer(due to the problems I experienced before) as well as 2 sets of all work externally and I examined the size of each generation and found that it increased disproportionately each time.

I then created a new mainstack and manually copied each card to the new mainstack, saved it and examined the size. The size of the livecode file went from 11,728kb to 1,120kb.

Guess what? Yes quite correct! It takes a second or less in the IDE to change cards!

So the problem is that livecode becomes bloated during the development process somehow.

I am much happier now knowing what is happening and the work around, but it would be better for all if the problem was remedied. Unfortunately, because I do not know what changes the size or what circumstances cause the change, it will not be possible to submit a sensible bug report.

Thanks for your time,
Hilton.

Re: Slow swapping from card to card[found reason]

Posted: Thu Aug 20, 2015 12:44 am
by dunbarx
Hi.

But you could submit both the old and new stacks. The team would be able to decipher the differences between them, and tell you, and us, what happened, and what to look for in the future.

Craig

Re: Slow swapping from card to card[found reason]

Posted: Thu Aug 20, 2015 12:45 am
by FourthWorld
I do some of my best work in my sleep. :)

What's in the 11MB file that's not in the new one?

Re: Slow swapping from card to card[found reason]

Posted: Thu Aug 20, 2015 1:42 am
by hilton
Hi folks,

Yes Craig you are quite correct. After I have got the answer to the next question from you folks I will do as you suggest - thanks.

Richard, I do not know because all I did was copy each card from the bloated mainstack to the new mainstack.
However, during my copying stuff from old to new main stacks, I could not figure out how to copy the data grid substack. I added a datagrid to the new main stack and then deleted it leaving the data grid substack behind. I then had to sort out my column behaviours again - a bit painful - it also means that I cannot put behaviours where stuff is unlinked.

What I will do once someone shows me how to copy the datagrid substack to the new stack successfully is to go through the copying process again and then as Craig suggests, I will submit both to support and see what happens.

Actually, a thought has just struck me. I just checked the size again and it has increased by 0.5mb and all I have done is fiddle with datagrids. I have a lot of them. Hmm, maybe it's a clue - I will try to fiddle some more and see where it leads me.

Thanks,
Hilton.

Re: Slow swapping from card to card[found reason]

Posted: Thu Aug 20, 2015 10:48 am
by hilton
Hi Folks,

I have found out how to transfer the datagrid substack to the new mainstack thanks. I can now cleanly transfer everything from one mainstack to another which helps if things get bloated.

I will now keep an eye on the file size and if I can see it growing I will do as Craig suggested.

Bye,
Hilton.