Skip to content
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

Closed
rakudrama opened this issue Oct 16, 2012 · 10 comments
Closed
Labels
dart2js-optimization P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug web-dart2js

Comments

@rakudrama
Copy link
Member

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) {
  return typeof a === 'number' && typeof b === 'number'
     ? a < b
     : $.boolConversionCheck($.lt$slow(a, b)); // this is the change wrt $.ltB
};

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.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Removed this from the Later milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Added this to the M2 milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Removed Priority-Medium label.
Added Priority-Low label.

@peter-ahe-google
Copy link
Contributor

Removed this from the M2 milestone.
Added this to the Later milestone.
Removed Priority-Low label.
Added Priority-Medium label.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed TriageForM5 label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@rakudrama
Copy link
Member Author

Obsolete - there are no longer relational helpers of this form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart2js-optimization P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants