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

Improve benchmark performance #200

Merged
merged 4 commits into from
May 14, 2020
Merged

Improve benchmark performance #200

merged 4 commits into from
May 14, 2020

Conversation

talex5
Copy link
Contributor

@talex5 talex5 commented May 13, 2020

This tunes the benchmark to get better performance:

  1. Limit the number of concurrent calls to 12, instead of sending all 100,000 at once.
  2. Choose more sensible sizes for the message buffers. This also exposes the size option in the API to allow user applications to choose the size of their requests and responses.

Results on my machine

Original:

echo_bench.exe: [INFO] rate = 23975.514051
echo_bench.exe: [INFO] rate = 23774.676839
echo_bench.exe: [INFO] rate = 23807.165267

Limit concurrency:

echo_bench.exe: [INFO] rate = 28369.413333
echo_bench.exe: [INFO] rate = 28242.881411
echo_bench.exe: [INFO] rate = 28636.375119

Reduce message sizes:

echo_bench.exe: [INFO] rate = 40065.965541
echo_bench.exe: [INFO] rate = 40835.360431
echo_bench.exe: [INFO] rate = 40146.473277

talex5 added 2 commits May 13, 2020 19:25
Sending 100,000 messages in parallel isn't a good way to use the system.

Before:

    echo_bench.exe: [INFO] rate = 23975.514051
    echo_bench.exe: [INFO] rate = 23774.676839
    echo_bench.exe: [INFO] rate = 23807.165267

After:

    echo_bench.exe: [INFO] rate = 28369.413333
    echo_bench.exe: [INFO] rate = 28242.881411
    echo_bench.exe: [INFO] rate = 28636.375119
By default, capnproto allocates 8k buffers. However, most capnp-rpc
messages are much smaller than this. This commit chooses more sensible
sizes (for the internal messages used by the benchmark test), and also
exposes the message size to users of the library for requests and
responses.

Before:

    echo_bench.exe: [INFO] rate = 28369.413333
    echo_bench.exe: [INFO] rate = 28242.881411
    echo_bench.exe: [INFO] rate = 28636.375119

After:

    echo_bench.exe: [INFO] rate = 40065.965541
    echo_bench.exe: [INFO] rate = 40835.360431
    echo_bench.exe: [INFO] rate = 40146.473277
@talex5 talex5 merged commit a3445df into mirage:master May 14, 2020
@talex5 talex5 deleted the benchmark branch May 14, 2020 09:24
talex5 added a commit to talex5/opam-repository that referenced this pull request May 14, 2020
…pc and capnp-rpc-unix (0.7.0)

CHANGES:

- Update for x509 0.11.0 API changes (@talex5, mirage/capnp-rpc#196).

- Update to new mirage network API (@Cjen1, mirage/capnp-rpc#198).

- Add echo benchmark test (@Cjen1, mirage/capnp-rpc#197).

- Estimate message sizes to improve performance (@talex5, mirage/capnp-rpc#200).
  By default, capnproto allocates 8k buffers, but most capnp-rpc messages are
  much smaller than this.

Logging:

- Fix application logging, to use library's log (@Cjen1, mirage/capnp-rpc#195).

- Expose the endpoint logger (@Cjen1, mirage/capnp-rpc#195).

- Only enable debug logging for capnp libraries in the calc example.
  TLS now generates a lot of messages at debug level (@talex5, mirage/capnp-rpc#200).
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.

1 participant