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

Investigate using LONGLONG for longints for small builds #3416

Closed
dhalbert opened this issue Sep 14, 2020 · 1 comment
Closed

Investigate using LONGLONG for longints for small builds #3416

dhalbert opened this issue Sep 14, 2020 · 1 comment
Milestone

Comments

@dhalbert
Copy link
Collaborator

The LONGLONG longint implementation uses 64-bit long long boxed integers. Because it's conceptually simpler than the MPZ implementation, it could be smaller in terms of firmware size. It would enable using time.monotonic_ns() on small builds, which is the primary reason I looked at this.

However, right now LONGLONG actually builds out to be larger than MPZ. This is primarily due to a few long long conversions to and from float that cause large double-precision floating-point library routines to be included in the firmware. They would not be present otherwise. I disabled these conversions temporarily to see what would happen.

After forcing out the double routines, the difference between a Trinket M0 NONE and LONGLONG is about 4000 bytes. A noticeable chunk of this is the enabling of the time routines` which are disabled when longints are not available. I assume it would take a few hundred bytes to do some other kind of conversion between longints and floats (or we would forbid it).

So this is still a substantial amount of firmware space, and too big for some of the translations, thought it does fit in the smaller languages.

(By comparison, enabling MPZ instead of LONGLONG adds another 3100 bytes or so.)

@dhalbert
Copy link
Collaborator Author

Closing because it does not seem feasible for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants