Skip to content

refactor: Reuse buffers for wide string conversion on Windows#738

Open
DataTriny wants to merge 1 commit into
mainfrom
windows-reuse-buffers
Open

refactor: Reuse buffers for wide string conversion on Windows#738
DataTriny wants to merge 1 commit into
mainfrom
windows-reuse-buffers

Conversation

@DataTriny

Copy link
Copy Markdown
Member

Initially extracted from stacked-alloc-refactors but significantly reworked.

Introduce reusable buffers for wide string conversion in the Windows adapter to reduce memory allocations. The initial work used two separate buffers tied to the adapter instance, I chose to go with a thread-local pool of buffers, mostly to avoid acquiring a lock for each node property getter, even if they don't convert strings. Multiple adapters can also share the same buffers. I capped the buffer size to avoid keeping large memory chunks around.

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