Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[mypyc] optimise startswith and endswith - #9557

Merged
JukkaL merged 1 commit into
python:masterfrom
r3m0t:mypyc-str-primitives
Oct 8, 2020
Merged

[mypyc] optimise startswith and endswith#9557
JukkaL merged 1 commit into
python:masterfrom
r3m0t:mypyc-str-primitives

Conversation

@r3m0t

@r3m0t r3m0t commented Oct 8, 2020

Copy link
Copy Markdown
Contributor

Description

Relates to mypyc/mypyc#644

Test Plan

Includes unit test

@TH3CHARLie TH3CHARLie left a comment

Copy link
Copy Markdown
Collaborator

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

JukkaL commented Oct 8, 2020

Copy link
Copy Markdown
Collaborator

@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

JukkaL commented Oct 8, 2020

Copy link
Copy Markdown
Collaborator

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