After upgrading from the 2020.3.21f1 version to the 2021.3.11f1 version, the loading time of addressables has increased tremendously.
In our current project, the addressable package version is 1.19.19. We didn’t touch addressable package version. (We also tried different addressable package versions such as 1.20.5 and 1.18.19)
I created a test scene to detect the problem. I placed only one button with a basic script. I’m trying to load a single addressable from Default Local Group.
If I add my TestCanvas to the Default Local Group it takes 0.5 seconds. If I add 50 SFX (mp3) to the Default Local Group
with my TestCanvas, it takes 15 seconds.
Here is my test script:
public class Test : MonoBehaviour
{
[SerializeField]
private TMP_Text _duration;
private Stopwatch _stopwatch;
void Start()
{
_stopwatch = new Stopwatch();
}
public void GetAddressableAndLoad()
{
_stopwatch.Start();
AsyncOperationHandle<Object> asyncOperationHandle = Addressables.LoadAssetAsync<Object>("testCanvas");
asyncOperationHandle.Completed += r =>
{
GameObject instantiate = Instantiate(r.Result) as GameObject;
_stopwatch.Stop();
_duration.text = _stopwatch.Elapsed.ToString();
};
}
}
After that, I opened two separate empty projects in 2020.3.21f1 and 2021.3.11f1 and added a similar test script. I have activated the Addressable package. I put 50 different SFX (mp3) files to projects and marked them as addressable.
In the 2020 version, TestCanvas load time was 0.5-0.6 seconds, while in the 2021 LTS version, this time was 1.6-1.7 seconds. The device I tested is android One Plus 6T.