JS performance: operators don't get inlined #27196
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
dart2js-optimization
web-dart2js
We are developing a computationally intensive web app, and one of the performance-critical parts is dealing with large bit sets. The program works fast enough in DartVM, however there is about 6x performance degradation compared to running the JS output in regular Chrome.
After running micro-benchmarks (I was careful, and the results are consistent across runs - see the attached code), we found out few interesting patterns. The two tests set every other bit in a bitset to true, the "inline" test is doing it in a straightforward manner, while the "operator" test sets it via the defined operator. "Chrome (min)" is the attached benchmark; "Chrome (app) is testing absolutely the same code, the only difference is that it is compiled as part of our big application. Here are the results (Win7 / DartVM 1.19, Chromium 1.19, Chrome 52):
... and the code (web.zip):
Upon further investigation, we found that the '=' operator got inlined in the benchmark code, but did not get inlined in the real application, which likely resulted in 2x performance penalty:
------------------ Chrome (min) : the operator is inlined
------------------ Chrome (app) : there is no inlining
Few questions (I'm not sure if this post qualifies as a bug report, but hopefully it gives some food for thoughts):
The text was updated successfully, but these errors were encountered: