[Webkit-unassigned] [Bug 271610] Web Inspector: Generating JS builtins for createInspectorInjectedScript is very slow
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Apr 2 02:08:59 PDT 2024
https://bugs.webkit.org/show_bug.cgi?id=271610
--- Comment #6 from Karl Dubost <karlcow at apple.com> ---
map is an iterator, list will convert it to a real list, but it does it one at a time.
Maybe the next step to try would be to replace the map with a list comprehension
Nope… it's no better.
In
list(map(BuiltinFunction.fromString, functionStrings))
the functionStrings iterator for InjectedScriptSource.js
has only 3 items, two short and the last one very long.
[418, 254, 57055]
The two firsts and the beginning of the third one which is a long list of functions.
######################
@linkTimeConstant
function createObjectWithoutPrototype(/**/)
{
if (arguments.length % 2 !== 0)
@throwRangeError("`createObjectWithoutPrototype` requires that each key argument be followed by a value, resulting in an even number of arguments.");
let object = @Object. at create(null)
for (let i = 0; i < arguments.length; i += 2)
object[arguments[i]] = arguments[i + 1];
return object;
}
######################
@linkTimeConstant
function createArrayWithoutPrototype(/**/)
{
let array = new @Array(arguments.length);
array.__proto__ = null;
for (let i = 0; i < arguments.length; ++i)
@arrayPush(array, arguments[i]);
return array;
}
######################
@linkTimeConstant
@visibility=PrivateRecursive
function createInspectorInjectedScript(InjectedScriptHost, inspectedGlobalObject, injectedScriptId)
{
function PrototypelessObjectBase() {}
PrototypelessObjectBase.prototype = null;
function toString(obj)
{
return @String(obj);
}
function toStringDescription(obj)
{
if (obj === 0 && 1 / obj < 0)
return "-0";
if (isBigInt(obj))
return toString(obj) + "n";
return toString(obj);
}
etc…
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240402/1d68f001/attachment.htm>
More information about the webkit-unassigned
mailing list