Why babylonjs draco wrapper files takes time to load?

image

Im using draco compression inside my glb model using gltf-pipeline
but when i going to load that model in babylonJs v5 it is taking too much time to load decoder files

https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js

How we can reduce the loading time of this

It is nearly taking 26 secs to load in the browser.

26 seconds sound like way too much for such a small file. Is that really the download time we are seeing?

Can you reproduce that in the playground? If it’s a network issue it should be the same there

BTW - you can host the file yourself, if that’s an option

1 Like

You can check this playground - https://playground.babylonjs.com/#DMZIBD#0 , seems to load very quickly

1 Like

Well Here im using multiple scenes each scene have a glb model.
https://www.wikipoint.co/checkin/winery_step2

Im simply using
BABYLON.SceneLoader.ImportMeshAsync()
To load the model

As a real-world test try not disabling cache (which will be turned on per default on most if not all browsers). When I do that, I get those times:

I believe those are not entirely download times, but also, for some odd reason, some processing time. I don’t see a reason why a file so small will take 11 seconds to load.

Having said that, @bghgary - will it be possible to only download once? or is that coming from the worker’s include-script call?

1 Like

Browsers should already be only downloading once based on empirical evidence. We just call importScripts and let the browser deal with it.

1 Like

what I expected. Can also be seen on my example - it takes < 10 ms to load it again. @Nilesh_Ghanchi1 - you never got back to us with an answer - is it a caching issue?

1 Like

If you have built your own app, I would bundle the draco wasm and js files with your app instead of relying on loading them from the babylon domain.

you can config it like this before starting the engine

import { DracoCompression } from '@babylonjs/core/Meshes/Compression/dracoCompression'

DracoCompression.Configuration = {
      decoder: {
        wasmUrl: '/assets/draco/draco_wasm_wrapper_gltf.js',
        wasmBinaryUrl: '/assets/draco/draco_decoder_gltf.wasm',
        fallbackUrl: '/assets/draco/draco_decoder_gltf.js',
      },
    }
3 Likes

Yes may be its an browser caching issue
I will try to load them locally
Thank you for your help.

2 Likes