New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dart2js: checked mode: move boolConversionChecks into relational helpers #5967
Comments
Added this to the Later milestone. |
Removed this from the Later milestone. |
Added this to the M2 milestone. |
Removed Priority-Medium label. |
Removed this from the M2 milestone. |
Added TriageForM5 label. |
Removed TriageForM5 label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Obsolete - there are no longer relational helpers of this form |
Unchecked code generates
if ($.ltB(index, end))
return;
whereas checked code generates:
if ($.boolConversionCheck($ .lt(index, end)))
return;
The code would be faster and smaller if the conversion check was pushed into the non-num branch, e.g
if ($.ltC(index, end))
return;
$.ltC = function(a, b) {$.boolConversionCheck($ .lt$slow(a, b)); // this is the change wrt $.ltB
return typeof a === 'number' && typeof b === 'number'
? a < b
:
};
One example where I tried this by hand (a merge sort, leaning heavily on < for loop control and comparing elements) was 0.5% smaller and 13% faster.
The text was updated successfully, but these errors were encountered: