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

Minify CellType #27

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Minify CellType #27

merged 1 commit into from
Apr 11, 2023

Conversation

adriandelgado
Copy link
Contributor

I changed some fields' types of the CellType enum from String to Box<str> or Rc<str>. Result:

Before After
Size (Bytes) 80 56
Alignment 8 6

This improves cache locality and allows the compiler to better optimize its use.

I also refactored the prepare_formula function because I needed it to output a Box<str> instead of a String.

Why Rc<str>?

To improve the performance of the shared_string_index function. This is a hot function that needs to clone strings some of the time. By using Rc<str> the clones become really cheap.

image

@jmcnamara jmcnamara merged commit 1c0dbea into jmcnamara:main Apr 11, 2023
5 checks passed
@jmcnamara
Copy link
Owner

Looks good. Merged. Thanks.

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

2 participants