Efficiency of the resource store for the live update


#1

We have a collection proxy which has 633 missing resource(the size is not big. the total size of all 1500+ resources is 9MB). When use a loop to store all of these missing resources, the callback of the last resource return after about 11 seconds on windows PC.

From line 1075 to line 1811 of this log file. log.zip (28.3 KB)

_

DEBUG:SCRIPT: [INFO 2019-03-08 14:44:34] game/scheduler/scheduler.script:22: try to download resource for collection proxy: /mahjong_proxy#xzdd with missing resource: 633
.
DEBUG:SCRIPT: finished switch proxy: url: [scheduler:/mahjong_proxy#xzdd] cost time: 10.985
_
The same project (andriod) costs about 20 seconds. As far as I know, store resource will write data in following container file. The time is too long for switch a proxy. Is there more infomation about the resource store implementation?
image

Maybe some buffer mechanism can be used to merge all data in the memory file first and then flush to disk with a certain frequency.


#2

Each resource is synchronously written to disk in sorted order, one by one. We might want to have an async API for this (something like what we have for loading collection proxies), but until then maybe you can help yourselves by spreading the storing of resources over several frames to at least keep the game from stalling.


#3

Created ticket DEF-3827 in our internal bug-tracking system for this task.


#4

Thanks Johan

I will use a background task to store part of the live update resources instead of doing store in a proxy switch. Then the missing resource count might be reduced in advance for some common used secens.

Please give me a note if you have a plan to fix it. This is important to us.
We have too many excluded resources(1500+ now and it will be doubled soon)