Skip to content
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

[mypyc] Implement str-to-float primitive #9685

Merged
merged 5 commits into from Nov 2, 2020
Merged

[mypyc] Implement str-to-float primitive #9685

merged 5 commits into from Nov 2, 2020

Conversation

TH3CHARLie
Copy link
Collaborator

related mypyc/mypyc#644

Implement builtins.float conversion from strings.

@TH3CHARLie
Copy link
Collaborator Author

str-to-float microbenchmark results:

before:

interpreted: 0.890635s (avg of 5 iterations; stdev 0.8%)
compiled:    0.823043s (avg of 5 iterations; stdev 0.9%)

compiled is 1.082x faster

after:

interpreted: 0.894912s (avg of 5 iterations; stdev 4.6%)
compiled:    0.348376s (avg of 5 iterations; stdev 3.1%)

compiled is 2.569x faster

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nice perf win!

Can you also add a test case for this? For example, create mypyc/test-data/run-floats.test, or add to mypyc/test-data/run-misc.test?

@TH3CHARLie
Copy link
Collaborator Author

A nice perf win!

Can you also add a test case for this? For example, create mypyc/test-data/run-floats.test, or add to mypyc/test-data/run-misc.test?

Sure, I'll merge this once the testcase is added and CI gets green

@TH3CHARLie TH3CHARLie merged commit 3ed4747 into python:master Nov 2, 2020
@TH3CHARLie TH3CHARLie deleted the str-to-float branch November 2, 2020 20:40
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.

None yet

3 participants