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

copr/expr: optimize like #2293

Merged
merged 6 commits into from Sep 15, 2017
Merged

copr/expr: optimize like #2293

merged 6 commits into from Sep 15, 2017

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Sep 14, 2017

This pr tries to optimize like by

  • reducing recurses as many as possible
  • reducing match as many as possible

According to bench, average match time is 2/3 less than before.

}
}
};
let next_pattern = pcs.as_str();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary?

if t == c || (c == '_' && (!escaped || escape == '%')) {
continue;
}
let mut skip_cnt = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip_cnt looks like also useless.

@hicqu
Copy link
Contributor

hicqu commented Sep 14, 2017

LGTM.

@BusyJay
Copy link
Member Author

BusyJay commented Sep 14, 2017

/run-all-tests

Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AndreMouche
Copy link
Member

/run-all-tests

@BusyJay BusyJay merged commit 296e447 into master Sep 15, 2017
@BusyJay BusyJay deleted the busyjay/optimize-like branch September 15, 2017 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants