Scrolling and dragging a section of graph on perfherder spends a lot of time in JS
Categories
(Core :: JavaScript Engine: JIT, defect, P2)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [fxp])
Attachments
(1 file)
77.12 KB,
image/png
|
Details |
Then I selected some region of the graph, and was using the mouse to move the selected region across the timeline
ER: Smooth movement
AR: janky movement. and the underlying graph takes a bit to come up
Reporter | ||
Comment 1•3 years ago
|
||
Comment 2•3 years ago
|
||
Iain, any ideas on what this could be from the profile?
Comment 3•3 years ago
|
||
It looks like the JS that's running is lodash. In particular, the function that shows up in the profiler as e.exports
is baseAssignValue
:
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
c<
is _.defaults
:
var defaults = baseRest(function(object, sources) {
object = Object(object);
var index = -1;
var length = sources.length;
var guard = length > 2 ? sources[2] : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
length = 1;
}
while (++index < length) {
var source = sources[index];
var props = keysIn(source);
var propsIndex = -1;
var propsLength = props.length;
while (++propsIndex < propsLength) {
var key = props[propsIndex];
var value = object[key];
if (value === undefined ||
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
object[key] = source[key];
}
}
}
return object;
});
And 636/l<
is the implementation of _.assign
:
var assign = createAssigner(function(object, source) {
if (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
So I think the hotspots here are megamorphic property access (including hasOwnProperty). This is consistent with NativeSetProperty
, GetNativeDataPropertyByValuePure
, and hasNativeDataPropertyPure
being the hottest C++ code.
The megamorphic property lookup cache in Jan's Watchtower work might help with this.
Comment 4•3 years ago
|
||
Per Comment 3, we can see if the current work on Watchtower helps with this. I will mark it as a P2 for now so we can validate this once we make more progress on Jan's work.
Reporter | ||
Comment 5•2 years ago
|
||
FWIW, this the profile from latest nightly : https://share.firefox.dev/3crEvqE
Reporter | ||
Comment 6•2 years ago
•
|
||
Profile from latest Nightly:
https://share.firefox.dev/3Ejj2fj
https://share.firefox.dev/3UH79oF
Reporter | ||
Comment 7•2 years ago
|
||
Profile from latest Nightly:
https://share.firefox.dev/3HLELxN
https://share.firefox.dev/3M0119B
Reporter | ||
Updated•14 days ago
|
Updated•14 days ago
|
Description
•