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

Skip to content

[mypyc] Implement bytes equality optimizations - #10928

Merged
msullivan merged 4 commits into
python:masterfrom
jhance:bytes-compare
Aug 25, 2021
Merged

[mypyc] Implement bytes equality optimizations#10928
msullivan merged 4 commits into
python:masterfrom
jhance:bytes-compare

Conversation

@jhance

@jhance jhance commented Aug 4, 2021

Copy link
Copy Markdown
Collaborator

Description

Implements part of mypyc/mypyc#880.

Implementation for the bytes comparison itself is stolen from the implementation of bytes_compare from cpython and inlined.
Later we can switch unicode to use a similar API

Test Plan

Added both IR tests and runtime tests. Made a custom benchmark that yielded performance gain of around 4x (from 2.3x faster to 9x faster than uncompiled vs master).

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

This looks good, though a test failure needs to be investigated

@msullivan

Copy link
Copy Markdown
Collaborator

This looks good, though a test failure needs to be investigated

Oh, the function needs declared in CPy.h. (I think we have a separate test for that because our default test compilation mode just #includes all the C files)

@JukkaL

JukkaL commented Aug 10, 2021

Copy link
Copy Markdown
Collaborator

Can you also merge master? There are merge conflicts.

@msullivan
msullivan merged commit 8c5c915 into python:master Aug 25, 2021
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