Skip to content

[mypyc] Implement bytes equality optimizations #10928

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 4 commits into from
Aug 25, 2021

Conversation

jhance
Copy link
Collaborator

@jhance jhance commented Aug 4, 2021

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).

Copy link
Collaborator

@msullivan msullivan left a comment

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
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
Copy link
Collaborator

JukkaL commented Aug 10, 2021

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