Skip to content

perf(form): eliminate multipart full-body clone - #84

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue-74-form-no-body-clone
Apr 27, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue-74-form-no-body-clone

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • remove full body_bytes.clone() from multipart parsing path in Rust dispatcher
  • consume the existing request body buffer using mem::take before parse_multipart
  • reduce peak memory overhead for large multipart payload handling

Test plan

  • uv run maturin develop --uv
  • uv run pytest tests/test_form_body.py tests/test_asgi.py

Closes #74

Move the multipart parse path to consume the existing request buffer via mem::take instead of cloning the full body, reducing peak memory overhead for large uploads.
@ZhuchkaTriplesix ZhuchkaTriplesix linked an issue Apr 27, 2026 that may be closed by this pull request
@ZhuchkaTriplesix ZhuchkaTriplesix added this to the v0.3.0 milestone Apr 27, 2026

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit c8a5311 into dev Apr 27, 2026
16 checks passed
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.

perf(form): eliminate full-body clone before multipart parsing

1 participant