Building addressables with cached elements using ScriptableBuildPipeline 1.21.21 EXTREMELY slow

After upgrading Addressables to 1.21.19 and ScriptableBuildPipeline to 1.21.21 we found that there’s a bug building with Build → New Build → Default Build Script

If there’s cached elements the process freezes when reaching the point shown here:

9446885--1325675--upload_2023-11-2_18-33-13.png

If we clear the cache it builds with no problem at all.

Also, when building addressables ‘slimWriteResults’ are overwritten from true to false. Can this be related since that flag is to improve cache performance?

EDIT: This also happens when using ‘Update a previous build’

Further investigation: Tried just updating ScriptableBuildPipeline to 1.21.21 without updating addressables and it happens. Reverting to 1.21.20 (and addressables 1.21.19) work without a hitch

It turns out it doesn’t freeze, building just becomes INCREDIBLY slow. What otherwise would took less than a minute takes now several minutes.

We performed the following test with ScriptableBuildPipeline 1.21.20 and 1.21.21:

  • Clear all addresables build cache.
  • Perform a full build. (New Build → Default build script)
  • Changed a string in a prefab contained in an asset group (only affecting a bundle)
  • Perform a full build and time it (only 1 bundle should be updated, the other are the previously built versions)

The results are as follows:

  • With ScriptableBuildPipeline 1.21.20: 42 seconds.
  • With ScriptableBuildPipeline 1.21.21: 18 minutes!!

Don’t know if slimWriteResults might be the culprit here, but its certainly suspicious and it gets overwritten to false everytime we try to build.

EDIT: Just rebuilding again with New Build → Default build script after a first clean build, even without having made any changes, also triggers this behavior

Looking into the modification of SBP 1.21.21, it seems there is a regression in CalculateSceneDependencyData.

As you can see, the break was moved inside the if block.

If the scene contains multiple Sprites, CalculateSceneDependencyData would call ContentBuildInterface.CalculatePlayerDependenciesForScene only once in 1.21.20, but in 1.21.21, it would call once for each Sprite!

Calling ContentBuildInterface.CalculatePlayerDependenciesForScene once should be enough.

5 Likes

Wow, nice catch there!

Is there any way to report this to the Addressables / ScriptableBuildPipeline team?

1 Like

I will submit a bug report to Unity. Before dev team fixes it, you can move SBP to Packages folder and fix it manually.

3 Likes

Thanks for the tip, we got scared there for a second, but after changing the ‘break’ positioning it works as expected.

Please, if you submit the bug repot to Unity Issue Tracker share the link so we can vote it

Regards!

1 Like

The bug report has been submitted: IN-59732. Once Unity QA confirmed the bug, I will share the public link here.

1 Like

Unity Regressionables

5 Likes

“Production Ready” is, at least, questionable…

4 Likes

Any updates on this?

1 Like

No, based on my experience, it usually takes days, even weeks for a bug report to be confirmed by Unity QA.

@davidla_unity

Do we have any news on this regression?

1 Like

Can confirm I experience this with version 2022.3.13 onwards. My last safe version to build from is 2022.3.11f1, which uses Addressables 1.21.18 with Scriptable Build Pipeline 1.21.20. As mentioned above, building takes an hour or so on the broken version where it would normally be 20 minutes.

1 Like

The bug report has not been processed by Unity.

1 Like

Bugger… Maybe @TreyK-47 , @andymilsom , @davidla_unity or @Ryanc_unity can check this out? I’ve seen a couple post around describing basically the same thing and is quite the regression for people using addressables

1 Like

EDIT: turns out Unity automatically finds packages that you move in to the Packages folder, and updated the package manifest. Didn’t need to do anything.

I’m being hit by this as well.
Can someone guide me to how I can set up the ScriptableBuildPipeline package to be in my project instead of in the package manager?

I don’t have any other custom packages, so I don’t know what this should look like after I copy the package folder into UnityProject/Packages

this is what it looks like now, but how doI change this to point to the new path?

  "com.unity.scriptablebuildpipeline": {
      "version": "1.21.21",
      "depth": 1,
      "source": "registry",
      "dependencies": {},
      "url": "https://packages.unity.com"
    },

any month now it will be fixed :slight_smile:

1 Like

After updating to Unity 2022, Addressable was unusually slow, so I was looking into what was wrong and found this thread.
Confirmed with 2022 3.14f.
Continue to follow this news