Significant lag

In our game we experience significant periodic lag (ca once per second) even when there is virtually nothing going on that should cause this. When using the profiler I noticed Sound.Master in some frames take 17ms or more, so I tried turning off music in that particular scene - but event though there is no sound the same behaviour can be observed.
I am still not sure Sound.Master is the cause of the lag though, but I still find it strange both that it is taking so much time generally and specifically when there is no sound.

Hello!

Looking into this, but can’t reproduce. A few questions;
On what platforms is this happening? Is this something new, or have you been experiencing this for a while, what Defold version are you using? Is this happening in every project you run?

It happens on at least both OSX and iOS (allthough when playing on my iPad the profiler hangs, so I can’t say it is the sam issue - but the lag is there). Generally it gets worse over the day, so it might be a memory/garbage collection issue. I also see abnormally long (~14 ms) Sprite.UpdateTransforms sometimes, but it seems to be mostly Sound.Master.

I only have one active project at the moment. I could give you access to the project and maybe give you directions on how to see the problem.

Hm, strange, if you can add sven.andersson@king.com to the project I can see if I can find out what is happening under the hood.

On a side-note, are you having problems with the profiler on iPad? In that case I’ll add an issue for it since that sounds like a nasty bug! :slight_smile:

You are added!

Yes, if I start the profiler with my iPad mini as target, the browser will hang.

1 Like

I´m experiencing the same problem as described here. Did you come up with a solution to it?

No, not this specifically. We have made a lot of optimisations regarding time slicing as much as possible (raycasts, pathfinding etc) that has made this issue less obvious and as of now we aren’t seeing this as often.

@Jens_Andersson Are you experiencing the exact same issue as Johan? Same platform(s)? Profiler showing nothing? Anything in logcat (if on Android)? On all target devices or just some?

yes, small stuttering every second. Tested on iPhone, Android, Windows and Mac, same issue on all devices.
I used the profiler and noticed a spike in Engine.Service.

Hmm, I don’t think Engine.Service is the problem, or does the spikes actually correspond exactly to when the you’re seeing the lag? Maybe @sven, @Ragnar_Svensson or @Andreas_Tadic has an idea?

Does the lag occur at a specific point in your game/app or is it from the moment you start? Can you disable certain parts of the code/app and isolate it?