Skip to content

perf: remove redundant Vec allocation in initialize_segment#2456

Closed
VolodymyrBg wants to merge 1 commit intoopenvm-org:mainfrom
VolodymyrBg:perf/remove-redundant-alloc
Closed

perf: remove redundant Vec allocation in initialize_segment#2456
VolodymyrBg wants to merge 1 commit intoopenvm-org:mainfrom
VolodymyrBg:perf/remove-redundant-alloc

Conversation

@VolodymyrBg
Copy link

Previously, initialize_segment allocated a new Vec for addr_space_access_count even though self.addr_space_access_count was already zeroed by the preceding lazy_update_boundary_heights call in check_and_segment. This caused unnecessary heap allocations on every segment initialization.
Reuse the existing buffer instead of creating a new one.

@jonathanpwang
Copy link
Contributor

Micro-optimization; not planned

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.

2 participants