The Wayback Machine - https://web.archive.org/web/20230328061812/https://github.com/tdlib/td/issues/755
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tdweb does the job again when wasm was built #755

Open
isopen opened this issue Oct 27, 2019 · 2 comments
Open

tdweb does the job again when wasm was built #755

isopen opened this issue Oct 27, 2019 · 2 comments

Comments

@isopen
Copy link
Contributor

isopen commented Oct 27, 2019

Here it loads for a long time:
https://github.com/tdlib/td/blob/master/example/web/tdweb/src/wasm-utils.js#L125
It seems that this is 100% processor load.

@levlam It looks like the assembly is not cached and starts over.

@isopen
Copy link
Contributor Author

isopen commented Oct 27, 2019

@levlam Maybe?

export async function instantiateAny(version, url, importObject) {
  console.log("instantiate");
  try {
    <save to wasm-cache<url, result>> << return await instantiateCachedURL(version, url, importObject); << <WebAssembly.instantiateStreaming>
  } catch (e) {
    console.log("instantiateCachedURL failed", e);
  }
  try {
    <save to wasm-cache<url, result>> << return await instantiateCachedURL(version, url, importObject); << <WebAssembly.instantiate>
  } catch (e) {
    console.log("instantiateSteaming failed", e);
  }
  throw new Error("can't instantiate wasm");
}

#757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant