Slow running in browser


#1

Realise I’ve been asking a lot of questions recently :sweat_smile:

I have an issue with my WIP running slow in the browser. This is not limited to my testing:

@KP_Paul “And it really is slow.”

I can also replicate the slowness right now on my phone for example. So don’t think it’s a browser issue…

At the moment I think it’s simply the sheer amount of code processes the WIP is running through in connection with a page-turning function (which I’d like to keep).

Does anyone have experience of slow running? What did you do about it?


#2

I have had that problem with very large code but after compiling the speed was back where it needed to be.


#3

Okay. So ideally I should compile any demos for testers, thanks @Lordirish, I think I can manage that


#4

Any really heavy processing/looping will indeed lock up the browser. Compiling won’t help with this directly. What compiling does help with is the speed of scene loading, so if you’re doing a lot of scene transitions (gosub_scene routine calls for e.g.), that’s when it will help.

Would you mind posting/linking your code?


#5

How would you like it?

Its probably a bit much to post here - and it relies on scene transitions (effectively there’s an ‘engine’ txt file for code, and a story file for… yeah)


#6

FWIW, scene transitions are improved by compiling.


#7

I recommend running randomtest and checking how many times any given line is hit compared to the number of tests you run. That should explain the slow down, and (probably) direct you to the point where you’d want to see if you can streamline.