Hi,

The threshold is defined in [1]. The Firefox issue is talking about a
different caching, that I assume you are not talking about. There is an
in-process cache of wasm modules, so if you compile the same module twice,
then the second compilation will just be a cache lookup. But when you
restart Chrome, or open a different web page, then this cache is not
available.

Cheers, Andreas

[1]
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/flags/flag-definitions.h;l=1330;drc=7972c3d25cbbd57b38bb275c36c105a7e03bcacb

On Mon, Sep 18, 2023 at 5:34 PM 'Michael Hagar' via v8-dev <
[email protected]> wrote:

> Thanks Andreas - what confused me is this comment on the Firefox bug
> tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1763375#c1 . I took
> that to mean that Chrome would cache compiled code for regular
> WebAssembly.instantiate, but I guess that's not the case, and it's only for
> the streaming functions.
>
> When you say "enough code", what are the current thresholds for caching
> the module?
>
> On Monday, September 18, 2023 at 10:21:44 AM UTC-5 [email protected] wrote:
>
>> Hi,
>>
>> The description should still be accurate. Did you make sure that enough
>> code gets optimized to trigger caching?
>>
>> Code does not get cached for WebAssembly.instantiate because we use the
>> url of the wasm module as the cache key, and with WebAssembly.instantiate
>> we don't know the url where the module came from.
>>
>> Cheers, Andreas
>>
>> On Mon, Sep 18, 2023 at 5:09 PM 'Michael Hagar' via v8-dev <
>> [email protected]> wrote:
>>
>>> Is the description here :
>>> https://v8.dev/docs/wasm-compilation-pipeline#code-caching still
>>> accurate?
>>>
>>> I was trying to confirm that using WebAssembly.compileStreaming would
>>> cache the optimized code, but I couldn't find the v8.wasm.cachedModule logs
>>> in the trace, nor the v8.wasm.moduleCacheHit logs.
>>>
>>> Is there any case where Chrome will cache optimized WASM code in the
>>> case that WebAssembly.instantiate is used? Or does it strictly require that
>>> WebAssembly.compileStreaming or WebAssembly.instantiateStreaming be used?
>>>
>>> --
>>> --
>>> v8-dev mailing list
>>> [email protected]
>>> http://groups.google.com/group/v8-dev
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/v8-dev/0305cb61-6162-4cd1-adde-226be3249ff9n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/v8-dev/0305cb61-6162-4cd1-adde-226be3249ff9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>>
>> Andreas Haas
>>
>> Software Engineer
>>
>> [email protected]
>>
>>
>> Google Germany GmbH
>>
>> Erika-Mann-Straße 33
>>
>> 80636 München
>>
>>
>> Geschäftsführer: Paul Manicle, Liana Sebastian
>>
>> Registergericht und -nummer: Hamburg, HRB 86891
>>
>> Sitz der Gesellschaft: Hamburg
>>
>>
>> Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
>> haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
>> löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
>> dass die E-Mail an die falsche Person gesendet wurde.
>>
>>
>>
>> This e-mail is confidential. If you received this communication by
>> mistake, please don't forward it to anyone else, please erase all copies
>> and attachments, and please let me know that it has gone to the wrong
>> person.
>>
>> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/a0c8e5cd-ae3e-4fc4-9708-c4e5e9cff8e2n%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-dev/a0c8e5cd-ae3e-4fc4-9708-c4e5e9cff8e2n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Andreas Haas

Software Engineer

[email protected]


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Liana Sebastian

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
dass die E-Mail an die falsche Person gesendet wurde.



This e-mail is confidential. If you received this communication by mistake,
please don't forward it to anyone else, please erase all copies and
attachments, and please let me know that it has gone to the wrong person.

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAELSTvcKNcp43QWbgwx2SYFAYo52vLTTgdE%2BMNkXb5ND0RKkJQ%40mail.gmail.com.

Reply via email to