Issue with serialiser

So we are using babylon js serialiser to save the data of scene in index DB of browser> we observed one small weird thing with that is, when we upload the model and serialize it, it takes a quite a lot time and when we transform the same model it takes almost same time but when we reload and load the same model from saved data and do the same operations and serialize it takes a lot less time. We belive that is babylon doing some caching. Is it possible to use the same caching mechanism on first load when we upload the model.

1 Like

To reduce the time of json loading/unloading make sure that your server uses gzip compression.
Another thing is to check if you save textures as JPG or PNG (by default).

1 Like

issue is not with json loading/unloading but the function SceneSerializer.SerializeAsync takes about 700 ms to serialize every time we call it with a ref to a scene , it dose the work of serialising all the buffers into array and encoding textures to base 64 every time it is called even to buffers have not changed between calls , so is there a way memoize this work so SceneSerializer dose not do the work of serialising buffers and textures , unless buffers and textures have been changed since last time it SceneSerializer was used .

1 Like

You would need to serialize the elements separately yourself in this case. Similar to what sceneSerializer does but with some caching.

This is an interesting feature.

1 Like