ogxd / project-curator

A convenient tool to help cleaning and maintaining Unity Projects 🧹✨
Do What The F*ck You Want To Public License
153 stars 27 forks source link

Improve overall performances #19

Open ogxd opened 1 year ago

ogxd commented 1 year ago

Context

Database persists in memory as an array of reference types (AssetInfos), with 2 array for each AssetInfo to keep track of references of dependencies. This is rather simple and straightforward however it has a few drawbacks:

Solution

Make AssetInfo an immutable struct and use a GUID type internally. Reference references and dependencies with indexes and ranges. This way AssetInfo is of constant size (blittable) and we can serialize everything in a few blobs. In memory, that would also mean keeping one big chunk instead of thousands of references.

rhys-vdw commented 1 year ago

Is this solution just a change to the serialization format? Each AssetInfo will still need to hold a variable length list of referencers (if I understand correctly).