-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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] Use a native unboxed representation for floats #14880
Merged
Merged
Commits on Mar 11, 2023
-
[mypyc] Use an unboxed representation for floats
Instead of each float value being a heap-allocated Python object, use unboxed C doubles to represent floats. This makes float operations much faster, and this also significantly reduces memory use of floats (when not stored in Python containers, which always use a boxed representation). Update IR to support float arithmetic and comparison ops, and float literals. Also add a few primitives corresponding to common math functions, such as `math.sqrt`. These don't require any boxing or unboxing. (I will add more of these in follow-up PRs.) Use -113.0 as an overlapping error value for floats. This is similar to native ints. Reuse much of the infrastructure we have to support overlapping error values with native ints (e.g. various bitmaps). Also improve support for negative float literals. There are two backward compatibility breaks worth highlighting. First, assigning an int value to a float variable is disallowed within mypyc, since narrowing down to a different value representation is inefficient and can lose precision. Second, information about float subclasses is lost during unboxing. This makes the bm_float benchmark about 5x faster and the raytrace benchmark about 3x faster. Closes mypyc/mypyc#966 (I'll create separate issues for remaining open issues).
Configuration menu - View commit details
-
Copy full SHA for 5620f68 - Browse repository at this point
Copy the full SHA 5620f68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ea696d - Browse repository at this point
Copy the full SHA 0ea696dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d5f397 - Browse repository at this point
Copy the full SHA 3d5f397View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8954cc9 - Browse repository at this point
Copy the full SHA 8954cc9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 62abec1 - Browse repository at this point
Copy the full SHA 62abec1View commit details -
Configuration menu - View commit details
-
Copy full SHA for c8214d0 - Browse repository at this point
Copy the full SHA c8214d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f222c1f - Browse repository at this point
Copy the full SHA f222c1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80ebe04 - Browse repository at this point
Copy the full SHA 80ebe04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ae9c98 - Browse repository at this point
Copy the full SHA 8ae9c98View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d874ce - Browse repository at this point
Copy the full SHA 9d874ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 916cda9 - Browse repository at this point
Copy the full SHA 916cda9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bbc76a - Browse repository at this point
Copy the full SHA 3bbc76aView commit details -
Configuration menu - View commit details
-
Copy full SHA for c208066 - Browse repository at this point
Copy the full SHA c208066View commit details -
Configuration menu - View commit details
-
Copy full SHA for 218def2 - Browse repository at this point
Copy the full SHA 218def2View commit details -
Configuration menu - View commit details
-
Copy full SHA for de5dd64 - Browse repository at this point
Copy the full SHA de5dd64View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1cdda1 - Browse repository at this point
Copy the full SHA c1cdda1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47acc06 - Browse repository at this point
Copy the full SHA 47acc06View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8dbd05a - Browse repository at this point
Copy the full SHA 8dbd05aView commit details -
Configuration menu - View commit details
-
Copy full SHA for fc5cd16 - Browse repository at this point
Copy the full SHA fc5cd16View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b2a642 - Browse repository at this point
Copy the full SHA 0b2a642View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1cb15ca - Browse repository at this point
Copy the full SHA 1cb15caView commit details -
Configuration menu - View commit details
-
Copy full SHA for 987d93e - Browse repository at this point
Copy the full SHA 987d93eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1054d4a - Browse repository at this point
Copy the full SHA 1054d4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f54e618 - Browse repository at this point
Copy the full SHA f54e618View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7e044e - Browse repository at this point
Copy the full SHA d7e044eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d3b7a3 - Browse repository at this point
Copy the full SHA 2d3b7a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 289bc29 - Browse repository at this point
Copy the full SHA 289bc29View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2de8e0b - Browse repository at this point
Copy the full SHA 2de8e0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2141f4d - Browse repository at this point
Copy the full SHA 2141f4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c98c043 - Browse repository at this point
Copy the full SHA c98c043View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40e991a - Browse repository at this point
Copy the full SHA 40e991aView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd117e6 - Browse repository at this point
Copy the full SHA fd117e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for d721828 - Browse repository at this point
Copy the full SHA d721828View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6205767 - Browse repository at this point
Copy the full SHA 6205767View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a4db2d - Browse repository at this point
Copy the full SHA 9a4db2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c89337 - Browse repository at this point
Copy the full SHA 4c89337View commit details -
Configuration menu - View commit details
-
Copy full SHA for 71d8568 - Browse repository at this point
Copy the full SHA 71d8568View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1462b9f - Browse repository at this point
Copy the full SHA 1462b9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d710b1 - Browse repository at this point
Copy the full SHA 0d710b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b4b7a1 - Browse repository at this point
Copy the full SHA 4b4b7a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72db9fc - Browse repository at this point
Copy the full SHA 72db9fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a4376c - Browse repository at this point
Copy the full SHA 4a4376cView commit details -
Configuration menu - View commit details
-
Copy full SHA for bdca8ab - Browse repository at this point
Copy the full SHA bdca8abView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc2aedf - Browse repository at this point
Copy the full SHA cc2aedfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 937df67 - Browse repository at this point
Copy the full SHA 937df67View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8e694f - Browse repository at this point
Copy the full SHA e8e694fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 00fd468 - Browse repository at this point
Copy the full SHA 00fd468View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01f670b - Browse repository at this point
Copy the full SHA 01f670bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6cd75b8 - Browse repository at this point
Copy the full SHA 6cd75b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6384c03 - Browse repository at this point
Copy the full SHA 6384c03View commit details -
Configuration menu - View commit details
-
Copy full SHA for a177197 - Browse repository at this point
Copy the full SHA a177197View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c5931d - Browse repository at this point
Copy the full SHA 3c5931dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ab5e25 - Browse repository at this point
Copy the full SHA 8ab5e25View commit details -
Configuration menu - View commit details
-
Copy full SHA for e85f057 - Browse repository at this point
Copy the full SHA e85f057View commit details
Commits on Mar 12, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e45dba5 - Browse repository at this point
Copy the full SHA e45dba5View commit details
Commits on Mar 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for c9d7147 - Browse repository at this point
Copy the full SHA c9d7147View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.