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

Skip to content

[mypyc] Add primitive for bytes slicing - #10966

Merged
JukkaL merged 6 commits into
python:masterfrom
97littleleaf11:bytes-slicing
Aug 12, 2021
Merged

[mypyc] Add primitive for bytes slicing#10966
JukkaL merged 6 commits into
python:masterfrom
97littleleaf11:bytes-slicing

Conversation

@97littleleaf11

Copy link
Copy Markdown
Collaborator

Description

Add a C helper function for bytes and bytearray slicing.

Test Plan

  • Run tests for both bytes and bytearray with return type checks.
  • IR build test for C helper func.

@97littleleaf11

Copy link
Copy Markdown
Collaborator Author

Implements part of mypyc/mypyc#880

@JukkaL JukkaL 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.

Nice! Looks good -- I measured over 2x improvement in the bytes_slicing microbenchmark. I just have a few ideas about more test cases.

Comment thread mypyc/lib-rt/bytes_ops.c Outdated
Comment thread mypyc/test-data/run-bytes.test
Comment thread mypyc/test-data/run-bytes.test Outdated
Comment thread mypyc/test-data/run-bytes.test

@JukkaL JukkaL 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.

Thanks! This is ready to merge after the builds are green.

@JukkaL
JukkaL merged commit 6444968 into python:master Aug 12, 2021
@97littleleaf11
97littleleaf11 deleted the bytes-slicing branch October 14, 2021 16:12
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.

2 participants