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

Optimize memory usage by avoiding intermediate buffer in message serialization #928

Merged
merged 5 commits into from
Apr 25, 2024

Commits on Apr 17, 2024

  1. Optimize memory usage by avoiding intermediate buffer in message seri…

    …alization
    
    This commit replaces the use of an intermediate buffer in the message serialization process with a direct write-to-buffer approach. The original implementation used MustMarshalBinary() which involved an extra memory copy to an intermediate buffer before writing to the final writeBuffer, leading to high memory consumption for large messages. The new WriteTo function writes message data directly to the writeBuffer, significantly reducing memory overhead and CPU time spent on garbage collection.
    luozhengjie.lzj committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    cd05731 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. add benchmark for write

    luozhengjie.lzj committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    1c14f45 View commit details
    Browse the repository at this point in the history
  2. benchmark for 1M/4M/8M

    luozhengjie.lzj committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    0aea51f View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. Tidy up new benchmarks

    anacrolix committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    3b1eaa9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    25b5a4f View commit details
    Browse the repository at this point in the history