Reducing size of catalog.json by optimizing 'm_extraDataString'

Our project has over 7000 bundles, and catalog.json is about 12.1MB. A large part of it is from ‘m_extraDataString’, which is about 8.3MB. After some investigation, I found there are lots of waste from serializing AssetBundleRequestOptions(every bundle has one AssetBundleRequestOptions object be serialized in m_extraDataString).

Here is the statistics for serializing one AssetBundleRequestOptions object:

Since AssetBundleRequestOptions is a builtin type of Addressables, I think Unity can use more compact serialization for it:

  • Don’t serialize AssemblyName
  • Don’t serialize TypeName
  • If json contains only ASCII characters, ASCII encoding should be used instead (Or always use UTF-8 instead).

@pillakirsten

Hi @Alan-Liu thanks for the feedback!

We do have a few existing methods to decrease the catalog.json size, have you tried them already?

Hi, pillakirsten

My purpose is reducing size of remote catalog, so ‘Compress Local Catalog’ dosen’t help. For ‘Internal Asset Naming Mode’, I’ll try it tomorrow, but it isn’t related to ‘m_extraDataString’.
Here is the stats for our catalog.json:
7984662--1025610--upload_2022-3-22_23-40-51.png

As you can see, the largest part is ‘m_extraDataString’, so I think optimizing it is most helpful to reduce size of catalog.json.

Oh I see, makes sense. I’ll create ticket for this request.

1 Like