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

Reduce UWORD to unsigned char #217

Closed
roconnor-blockstream opened this issue Jan 30, 2024 · 1 comment
Closed

Reduce UWORD to unsigned char #217

roconnor-blockstream opened this issue Jan 30, 2024 · 1 comment

Comments

@roconnor-blockstream
Copy link
Collaborator

Double check this, but the memory allocation of many bit sized frames ends up bloated due to the large UWORD size. Better just to make it 8-bit when possible.

@roconnor-blockstream
Copy link
Collaborator Author

The number of frames is limited to less that CELLS_MAX, which is currently 5 Mebi.
Each frame is at least one UWORD, which tends to be 8 bytes in size.
A frameItem, contains the frame location and cursor location, is 16 bytes, though could probably be reduced to 8 bytes.

So the total allocation of the cells and the frame stack is at most CELLS_MAX×(8+16) = 120 Mebibytes, which probably isn't so bad. Reducing the frameItem size would be slightly more impactful than reducing the UWORD size, and should probably be pursued first, as part of a broader memory reduction refactoring (see #125).

The current UWORD size means moving frames has very good alignment, and maybe that is helpful?

I'm going to close this for now as I consider the current allocation acceptable.

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

No branches or pull requests

1 participant