Open dcharkes opened 3 years ago
I thought this could be related to changes made to support deferred holders. However, this bug seems to be much older. I still see this issue even after reverting until August 17th, 2020.
Hi, do we have any ideas for this issue? Otherwise we should disable these benchmarks on dart2js to save the resources.
I will take a look.
Question about the benchmark - why is it showing in the charts as RunTimeRaw rather than Runtime as Score like the majority of benchmarks? Perhaps this could be selectable? I would always use Score for the left axis of chart, but would like to be able to see the raw numbers, perhaps as a right-axis on the large charts, or in the hover info.
Using Score has the advantage that each 2x performance increase looks similar and gives a readable chart for ongoing improvements, whereas a raw time on the axis has the effect of making each 2x speed increase look less and less significant. A temporary 100x regression on a chart with a 'raw' axis yields a chart that is unusable.
Thanks Stephen :)
The VM team often care about the absolute time to do a particular operation and tends to prefer RunTimeRaw for that reason, if I understood correctly. The benchmark author can choose what they prefer. I agree about the usability differences and different mind sets and I want to unify RunTime and RunTimeRaw more in the future as it is just a different perspective on the same data. I believe we already have a feature enhancement filed about this topic.
I didn't see this issue, investigated the same problem, and came up with a reduced test case for this. I also can get a slightly different error if I pass the --benchmarking-production flag to dart2js. I get a "map.get$length is not a function" Without the --benchmarking-production flag, I get a "t1.toString$0 is not a function" on the output of the previous map.get$length.
The reduced code, compiled with
and run with
third_party/d8/linux/x64/d8 sdk/lib/_internal/js_runtime/lib/preambles/d8.js out.jsis
is
abstract class MapLookupBenchmark {
MapLookupBenchmark();
Map<String, String> get myMap;
void printLength() {
final map = myMap;
print(map.length);
}
}
const const1 = <String, String>{
'0': '1',
};
final final1 = <String, String>{
'0': '1',
};
const const5 = <String, String>{
'0': '1',
'1': '2',
'2': '3',
'3': '4',
'4': '5',
};
class Constant1 extends MapLookupBenchmark {
Constant1();
@override
Map<String, String> get myMap => const1;
}
class Final1 extends MapLookupBenchmark {
Final1();
@override
Map<String, String> get myMap => final1;
}
class Constant5 extends MapLookupBenchmark {
Constant5();
@override
Map<String, String> get myMap => const5;
}
void main() {
Constant1();
Constant5();
// print(Final1().myMap.length); // No failure if this is uncommented.
Final1().printLength();
}
When running the new MapLookup benchmark in dart2js it crashes.
The crash occurs with the benchmark file as is, but also with some benchmarks cut out.
However, removing one of the earlier benchmarks makes the next one succeed.
The diff in
out.js
indeed shows the missing$index
method inH.JsLinkedHashMap.prototype
:cc @sigmundch @rakudrama