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

revert: "perf: reduce Module size" #7

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

hyf0
Copy link
Member

@hyf0 hyf0 commented Sep 19, 2023

Reverts #6

Module would be stored in Vec, which is already in the heap. Wrapping with Box will cause extra dereferencing on every visiting, which Module would be visited frequently a lot.

ExternalModule are few, you don't need to worry about the memory usages now.

@hyf0 hyf0 merged commit 711ddb0 into main Sep 19, 2023
@hyf0
Copy link
Member Author

hyf0 commented Sep 19, 2023

@underfin Reducing type size is a good way to improve performance, but it also has it's own restrictions.

Replacing Box<str> with thin_str is a win, but it's not only about reducing the size. Box<Box<str>>(1 * usize) is also smaller than Box<str>(2 * usize), but accessing Box<Box<str>> would be much slower than Box<str>.

@hyf0 hyf0 deleted the revert-6-perf-box-module branch September 19, 2023 13:21
@hyf0 hyf0 restored the revert-6-perf-box-module branch September 19, 2023 13:22
@hyf0 hyf0 deleted the revert-6-perf-box-module branch September 19, 2023 13:26
@hyf0 hyf0 restored the revert-6-perf-box-module branch September 19, 2023 13:26
@underfin underfin deleted the revert-6-perf-box-module branch September 25, 2023 12:12
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.

1 participant