Improving v8::String::MakeExternal performance

29 views
Skip to first unread message

Keyhan Vakil

unread,
Apr 6, 2023, 4:07:15 PM4/6/23
to v8-...@googlegroups.com
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?

Patrick Thier

unread,
Apr 11, 2023, 7:50:02 AM4/11/23
to v8-...@googlegroups.com
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?

--
--
v8-dev mailing list
v8-...@googlegroups.com
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 v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAOR4dTrrk%2BUpje60UDCAyXKBpyk8hbCnGm%2BiM50HkY4%3D-NrmpQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages