Your suggestion makes sense. We don't access strings that are not
internalized/thin from compilation background threads, so we don't need the
mutex for them.
Would you like to create a CL?

On Thu, Apr 6, 2023 at 10:07 PM 'Keyhan Vakil' via v8-dev <
[email protected]> wrote:

> I was looking at profiles of v8::String::MakeExternal and I noticed that
> it spends most of its time locking a mutex [0]. I don't understand why this
> mutex needs to be locked if !is_internalized. I think it could be replaced
> with:
>
> base::SharedMutexGuardIf<base::kExclusive> shared_mutex_guard(
>       isolate->internalized_string_access(), is_internalized);
>
> Thoughts?
>
> [0]:
> https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:v8/src/objects/string.cc;l=447;drc=2dfb6431910db3004672ccb94df3ce09d13e8770;bpv=0;bpt=1
>
> --
> --
> 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/CAOR4dTrrk%2BUpje60UDCAyXKBpyk8hbCnGm%2BiM50HkY4%3D-NrmpQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/v8-dev/CAOR4dTrrk%2BUpje60UDCAyXKBpyk8hbCnGm%2BiM50HkY4%3D-NrmpQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
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/CAKhjTa_RDUZ4q6DWbsNgDcDM7UBX8BbHnR4ubnt9ET_gfrygUw%40mail.gmail.com.

Reply via email to