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

windows: Pool buffers for reads/writes #245

Closed
alexcrichton opened this issue Aug 25, 2015 · 0 comments
Closed

windows: Pool buffers for reads/writes #245

alexcrichton opened this issue Aug 25, 2015 · 0 comments
Labels
windows Related to the Windows OS.

Comments

@alexcrichton
Copy link
Contributor

Right now all reads/writes allocate a buffer whenever they happen. This can be quite expensive and it'd probably be more useful to pool buffers between operations. For example the event loop could have a cache of buffers which are handed out on reads/writes.

Probably want to benchmark the impact before/after as well.

@carllerche carllerche added the windows Related to the Windows OS. label Aug 25, 2015
alexcrichton added a commit to alexcrichton/mio that referenced this issue Aug 28, 2015
This adds a cache of buffers to be stored locally on the selector for new
requests to use for both reads and writes. The cache has a maximum size of the
number of buffers it can store and new buffers are allocated if the cache is
empty at the time.

Closes tokio-rs#245
alexcrichton added a commit to alexcrichton/mio that referenced this issue Aug 28, 2015
This adds a cache of buffers to be stored locally on the selector for new
requests to use for both reads and writes. The cache has a maximum size of the
number of buffers it can store and new buffers are allocated if the cache is
empty at the time.

Closes tokio-rs#245
alexcrichton added a commit to alexcrichton/mio that referenced this issue Aug 28, 2015
This adds a cache of buffers to be stored locally on the selector for new
requests to use for both reads and writes. The cache has a maximum size of the
number of buffers it can store and new buffers are allocated if the cache is
empty at the time.

Closes tokio-rs#245

Conflicts:
	src/sys/windows/mod.rs
	src/sys/windows/selector.rs
	src/sys/windows/tcp.rs
	src/sys/windows/udp.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Related to the Windows OS.
Projects
None yet
Development

No branches or pull requests

2 participants