Skip to content

[mypyc] optimise startswith and endswith #9557

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

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

r3m0t
Copy link
Contributor

@r3m0t r3m0t commented Oct 8, 2020

Description

Relates to mypyc/mypyc#644

Test Plan

Includes unit test

Copy link
Collaborator

@TH3CHARLie TH3CHARLie left a comment

Choose a reason for hiding this comment

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

LGTM and thanks for adding more primitives to mypyc!

@JukkaL Do you think is it worth to implement these two ops directly in the irbuild?(I've checked and it's possible to do so)

@JukkaL
Copy link
Collaborator

JukkaL commented Oct 8, 2020

@TH3CHARLie Except for the most performance critical primitives it's better to use a wrapper function, since they are easier to write and maintain. If these turn out to be bottlenecks in some (realistic) benchmarks, we can consider implementing these in irbuild.

@JukkaL JukkaL merged commit 08f207e into python:master Oct 8, 2020
@JukkaL
Copy link
Collaborator

JukkaL commented Oct 8, 2020

I checked that this improves the str_methods microbenchmark (in https://github.com/mypyc/mypyc-benchmarks) from 1.3x faster than CPython to 1.9x faster (on Linux)!

The results should automatically update overnight here so we can see how it performs on the benchmarks server: https://github.com/mypyc/mypyc-benchmark-results/blob/master/reports/summary-microbenchmarks.md

@r3m0t r3m0t deleted the mypyc-str-primitives branch October 12, 2020 10:30
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.

3 participants