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

Skip to content

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

Merged
TH3CHARLie merged 5 commits into
python:masterfrom
TH3CHARLie:str-to-float
Nov 2, 2020
Merged

[mypyc] Implement str-to-float primitive#9685
TH3CHARLie merged 5 commits into
python:masterfrom
TH3CHARLie:str-to-float

Conversation

@TH3CHARLie

Copy link
Copy Markdown
Collaborator

related mypyc/mypyc#644

Implement builtins.float conversion from strings.

@TH3CHARLie

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

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

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
Copy Markdown
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.

3 participants