Construct the sharedLibraries webidl array by using JS API instead of JS_ParseJSON
Categories
(Core :: Gecko Profiler, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | affected |
People
(Reporter: canova, Unassigned)
References
Details
With Bug 1776694, we are now returning the additional information with the profile data in getProfileDataAsGzippedArrayBuffer
Web IDL API. To be able to convert the std::vector<SharedLibrary>
into an array of js objects, we are first serializing this vector into JSON, and then parsing it back into JS objects by using JS_ParseJSON
. This is not good because it's slower and uses more memory.
Instead of doing this, for each shared library, we can call JS_NewPlainObject
and then JS_SetProperty
for each property. And then use JS::NewArrayObject
and JS_DefineElement
to make an array for all of them.
Also, we don't want to include mStart, mEnd and mOffset properties while serializing because they are not accurate since each process will have different values for them. We can omit them directly in this custom serialization process.
Comment 1•2 years ago
|
||
It might be better to use XPIDL bindings for these structs + arrays, rather than the raw JS API. I haven't worked with either much.
Description
•