Bug Report: Hopscotch code execution speed slows to 50%

Bug Report @Liza @Rodrigo @Montoya @thomas

Your username: ThinBuffaloSr

Hopscotch Version: 3.12.0

What kind of device are you using?: iPad iOS 10.2

Description of the problem:
Hopscotch code execution speed slows to 50% after a new draft is saved.

I created a simple (pseudo) “FPS meter” so, as a relative measure, I could see quantitatively when a project slows down. What I noticed is that new projects run twice as fast as the same project after exiting to the home screen & returning to the project. I’ve tried this with multiple projects with the same results. And I’ve tried it with only the “fps meter” (one object).

When “brand new” the FPS meter reads: 61-63
Once the draft is saved and reopened it reads: 31-32
When published it reads: 31-32

15 Likes

Woah! That is so cool!
Do you have a project link?

2 Likes

Sure, @Snoopy. The linked project was a simple trail art experiment to see if I use many clones(pens) to create the art (for a project splash screen, for example), how much lag would be incurred after the art was done with the "pens" just sitting idle.

Just to note the results: With the latest app version 1 pen, 100 pens, and 500 pens all show the same "fps" when the art is done. This illustrates what I've said before. Just using a lot of clones doesn't cause lag, it's what you do with them. For example, the count down at the beginning (while the clones are created) is coded with a logical "and" so only the original text object updates the number. Otherwise all of the clones (which are increasing in number) update their text and it lags significantly.

fps is in the upper left corner:

5 Likes

Ooh, interesting. I tested it out and it does do that.

2 Likes

I'm pretty sure @Steelhooves made something like this.

Yes. Many hops have made a variety of fps meters, but that's not the point of the topic. I would recommend more hops to add one to their project during development since it's so simple and useful. But let's stay on topic since this is a bug report. My bad for initially segueing.

2 Likes

Cool! I´ll do this for an experiment in the old version of HS that I have, with the old editor (not the iPhone editor that then came to iPad).'

Edit: I opened the project on my computer, a Toshiba Satellite Pro if it matters, and it showed numbers around 11 to 28 FPS...

1 Like

Yes, that's because most laptops run around 30 fps,and some applications can lower that?

2 Likes

Relating to this, sometimes when I test run Run (XD), the FPS Meyer jumps up and reaches a max of 50 or so, while other times it maxes out at 30.

On my iPad it's at like 1-3
I need a new iPad

3 Likes

Does restarting Hopscotch have any effect with the project's speed?

Nope. Restarting doesn't make any difference for me.

Could be a save corruption bug. Hm..

This is a bug, but not exactly what you think:
Hopscotch is designed to run at 60fps. Since you are only waiting 500ms between resetting count, the bug you are seeing is that game starts rule runs at 120fps the first time you play it (basically, the player activates each "game starts" rule twice on the first play). After you publish the project is correctly running each "game starts" rule only once and reverts back to 60fps.

We've had this intermittently for a while, it mostly shows up on slightly older devices (for example, my iPhone 6s+ doesn't get it). It's on our list to fix for sure!

7 Likes

@awesomeonion Thanks for looking at this! Great explanation & good information (I'd realized my fps was based on 500ms but the project was published so I left it. Originally I'd just wanted a relative measure and liked the refresh rate of fp1/2s). That's too bad. I was hoping there might be an easy fix to double the fps :wink:

2 Likes

@ThinBuffalo I messed up... note that fps means 'frames per second'. You and I have only counted the fps to 500ms, instead of 1000ms.

1 Like