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

Wasm benchmark runner does duplicate requests? #48

Open
danleh opened this issue Feb 13, 2025 · 0 comments
Open

Wasm benchmark runner does duplicate requests? #48

danleh opened this issue Feb 13, 2025 · 0 comments

Comments

@danleh
Copy link
Contributor

danleh commented Feb 13, 2025

The Wasm runner(s) (both the new WasmEMCCBenchmark and the WasmLegacyBenchmark) do an unnecessary second request/fetch for resources in plan.preload. See attached screenshot, for example with gcc-loops-wasm:

Image

In most cases, browsers will fulfill the second request from the cache (as it is here), but we should still clean this up. A naive or misconfigured web server could potentially also disallow caching.

I believe the reason is that we have different code for preloading resources, once in the base class Benchmark:

async doLoadBlob(resource) {

and once again in the Wasm benchmark classes
var xhr = new XMLHttpRequest();

It seems the latter should reuse the former, which also would get rid of some code duplication.

Any subtlety or underlying reason I am missing why this second preloading mechanism is there?

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

No branches or pull requests

1 participant