KEMBAR78
[mypyc] optimise startswith and endswith by r3m0t · Pull Request #9557 · python/mypy · GitHub
Skip to content

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