Skip to content

Improve the Client's performance for non-stream bodies #16213

Improve the Client's performance for non-stream bodies

Improve the Client's performance for non-stream bodies #16213

Triggered via pull request June 20, 2024 00:35
Status Cancelled
Total duration 1m 5s
Artifacts

ci.yml

on: pull_request
Matrix: Build and Test
Matrix: Jmh CachedDateHeaderBenchmark
Matrix: Jmh CookieDecodeBenchmark
Matrix: Jmh EndpointBenchmark
Matrix: Jmh HttpCollectEval
Matrix: Jmh HttpCombineEval
Matrix: Jmh HttpNestedFlatMapEval
Matrix: Jmh HttpRouteTextPerf
Matrix: Jmh ProbeContentTypeBenchmark
Matrix: Jmh SchemeDecodeBenchmark
Matrix: Jmh ServerInboundHandlerBenchmark
Matrix: Jmh UtilBenchmark
Matrix: Performance Benchmarks (SimpleEffectBenchmarkServer)
Matrix: Performance Benchmarks (PlainTextBenchmarkServer)
Matrix: Unsafe Scoverage
Matrix: Release Drafter
Matrix: Publish Artifacts
Matrix: Cache Jmh benchmarks
Fit to window
Zoom out
Zoom in

Annotations

32 errors and 4 warnings
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
Resource not accessible by integration { name: 'HttpError', id: '9589747994', status: 403, response: { url: 'https://api.github.com/repos/zio/zio-http/releases', status: 403, headers: { 'access-control-allow-origin': '*', 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset', connection: 'close', 'content-encoding': 'gzip', 'content-security-policy': "default-src 'none'", 'content-type': 'application/json; charset=utf-8', date: 'Thu, 20 Jun 2024 00:36:02 GMT', 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin', server: 'GitHub.com', 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload', 'transfer-encoding': 'chunked', vary: 'Accept-Encoding, Accept, X-Requested-With', 'x-accepted-github-permissions': 'contents=write; contents=write,workflows=write', 'x-content-type-options': 'nosniff', 'x-frame-options': 'deny', 'x-github-api-version-selected': '2022-11-28', 'x-github-media-type': 'github.v3; format=json', 'x-github-request-id': '0C66:E78CE:3903FE:5C2222:66737972', 'x-ratelimit-limit': '5000', 'x-ratelimit-remaining': '4986', 'x-ratelimit-reset': '1718847066', 'x-ratelimit-resource': 'core', 'x-ratelimit-used': '14', 'x-xss-protection': '0' }, data: { message: 'Resource not accessible by integration', documentation_url: 'https://docs.github.com/rest/releases/releases#create-a-release', status: '403' } }, request: { method: 'POST', url: 'https://api.github.com/repos/zio/zio-http/releases', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'probot/12.2.5 octokit-core.js/3.5.1 Node.js/16.20.2 (linux; x64)', authorization: 'token [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: '{"target_commitish":"refs/pull/2919/merge","name":"v3.0.0 🌈","tag_name":"v3.0.0","body":"## Changes\\n\\n- Generate maps for additional properties in OpenAPI code gen (#2901) @987Nabil (#2921)\\n- Update test that was deliberately failing before JS regex fix @swoogles (#2917)\\n- Add `description` annotation content to docs for open API (#2722) @987Nabil (#2914)\\n- Modify JS client and fix tests @pablf (#2909)\\n- Fix ScalaJS regex and regression tests @pablf (#2912)\\n- Access latest route pattern when mapping route errors (#2823) @987Nabil (#2915)\\n- Fix memory leak in netty connection pool @kyri-petrou (#2907)\\n- Htmx attributes are unimportable @daharon (#2910)\\n- Avoid allocation of new path when resolving path ambiguities @kyri-petrou (#2904)\\n- Try all resolved IP addresses when client fails to connect @kyri-petrou (#2905)\\n- Fix for routes with different parameter names @kyri-petrou (#2903)\\n- fix: Ignore everything after closing boundary when parsing multi form data @seakayone (#2862)\\n- Fix OpenAPI security schema (#2813) @987Nabil (#2893)\\n- Implement streaming of multipart field data @kyri-petrou (#2899)\\n- Remove leading/trailing whitespaces from rendered authorization header @kyri-petrou (#2900)\\n- Simpler default `Endpoint#implement` (#2811) @987Nabil (#2894)\\n- fix: broken link in readme @ezhil56x (#2883)\\n- Use text over application media type for file serving; add charset @987Nabil (#2890)\\n- add tests for Routes.serveDirectory and Routes.serveResources @sullivan- (#2891)\\n- Endpoints as list in CodeGen to avoid duplicate key elimination (#2836) @987Nabil (#2892)\\n- Prefer user given content type over default generation (#2748) @987Nabil (#2896)\\n- Add `Server.serve` variant that accepts `Route` (#2805) @987Nabil (#2895)\\n- Fix Client manual interruption @kyri-petrou (#2889)\\n- Remove invalid `HttpApp` references @mijicd (#2881
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
HttpError: Resource not accessible by integration at /home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:8462:21 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Job.doExecute (/home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:30793:18) { name: 'AggregateError', event: { id: '9589747994', name: 'pull_request', payload: { action: 'edited', changes: { body: { from: 'This PR reimplements the way that we "collect" the response body when the user uses `asArray`, `asChunk`, `asText` etc. (basically any method other than `asStream`).\r\n' + '\r\n' + 'When those methods are used, regardless of whether we use a ZStream or just a plain `ArrayBuilder` as the buffer, we will be materializing the entire body into memory. Therefore, we can avoid all the overheads of ZStream and simply buffer the entire response into the array builder which performs much better.\r\n' + '\r\n' + "Since we don't have benchmarks for the Client, I don't have any results to show at the moment, but based on some local testing I'm seeing the following:\r\n" + '- ~20% improvement of using `asChunk` vs `asStream.collectAll`\r\n' + '- ~35-40% improvement over the baseline (series/2.x). This is due to some of the optimizations that benefit both streaming and non-streaming bodies\r\n' + '\r\n' + "In the meantime, while this PR is being reviewed, I'll try and add some benchmarks for the client\r\n" + '\r\n' + 'Note:\r\n' + "The one thing I'm a bit sceptical about this implementation is whether the aggregation should be happening within `UnsafeAsync.Aggregating` instead of within `AsyncBodyReader`. I think semantically it would have been better to have this logic within `UnsafeAsync.Aggregating`, but unfortunately the performance is not _as good_ as doing this within the `AsyncBodyReader` since we can't utilize a single ArrayBuilder to buffer the entire response, and so we need to create an intermediate array when `connect` is called.\r\n" + '\r\n' + "@jdegoes Let me know what you think. Do we want to prioritise an implementation that performs better or one that it's cleaner/easier to reason with and follow" } }, number: 2919, organization: { avatar_url: 'https://avatars.githubusercontent.com/u/49655448?v=4', description: 'ZIO — Real World Functional Programming', events_url: 'https://api.github.com/orgs/zio/events', hooks_url: 'https://api.github.com/orgs/zio/hooks', id: 49655448, issues_url: 'https://api.github.com/orgs/zio/issues', login: 'zio', members_url: 'https://api.github.com/orgs/zio/members{/member}', node_id: 'MDEyOk9yZ2FuaXphdGlvbjQ5NjU1NDQ4', public_members_url: 'https://api.github.com/orgs/zio/public_members{/member}', repos_url: 'https://api.github.com/orgs/zio/repos', url: 'https://api.github.com/orgs/zio' }, pull_request: { _links: { comments: { href: 'https://api.github.com/repos/zio/zio-http/issues/2919/comments' }, commits: { href: 'https://api.github.com/repos/zio/zio-http/pulls/2919/commits' }, html: { href: 'https://github.com/zio/zio-http/pull/2919' }, issue: { href: 'https://api.github.com/repos/zio/zio-http/issues/2919' }, review_comment: { href: 'https://api.github.com/repos/zio/zio-http/pulls/comments{/number}' }, review_comments: { href: 'https://api.github.com/repos/zio/zio-http/pulls/2919/comments' }, self: { href: 'https://api.github.com/repos/zio/zio-http/pulls/2919' }, statuses: { href: 'https://api.github.com/repos/zio/zio-http/statuses/d694b5943b889b4b8963a2b4f3883ffc94e
Build and Test (ubuntu-latest, 3.3.3, graal_graalvm@21)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 3.3.3, graal_graalvm@21)
The operation was canceled.
Build and Test (ubuntu-latest, 2.12.19, graal_graalvm@21)
The operation was canceled.
Build and Test (ubuntu-latest, 3.3.3, temurin@21)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 3.3.3, temurin@21)
The operation was canceled.
Build and Test (ubuntu-latest, 2.12.19, temurin@21)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 2.12.19, temurin@21)
The operation was canceled.
Build and Test (ubuntu-latest, 3.3.3, graal_graalvm@17)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 3.3.3, graal_graalvm@17)
The operation was canceled.
Build and Test (ubuntu-latest, 2.12.19, temurin@17)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 2.12.19, temurin@17)
The operation was canceled.
Build and Test (ubuntu-latest, 3.3.3, temurin@17)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 3.3.3, temurin@17)
The operation was canceled.
Build and Test (ubuntu-latest, 2.13.14, graal_graalvm@17)
The operation was canceled.
Unsafe Scoverage (ubuntu-latest, 2.13.14, temurin@8)
The run was canceled by @kyri-petrou.
Unsafe Scoverage (ubuntu-latest, 2.13.14, temurin@8)
The operation was canceled.
Build and Test (ubuntu-latest, 2.13.14, graal_graalvm@21)
The operation was canceled.
Build and Test (ubuntu-latest, 2.12.19, graal_graalvm@17)
The operation was canceled.
Build and Test (ubuntu-latest, 2.13.14, temurin@17)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 2.13.14, temurin@17)
The operation was canceled.
Build and Test (ubuntu-latest, 2.13.14, temurin@21)
The run was canceled by @kyri-petrou.
Build and Test (ubuntu-latest, 2.13.14, temurin@21)
The operation was canceled.
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: release-drafter/release-drafter@v5. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Build and Test (ubuntu-latest, 3.3.3, graal_graalvm@21)
Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995
Build and Test (ubuntu-latest, 2.12.19, graal_graalvm@21)
Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995
Build and Test (ubuntu-latest, 2.13.14, graal_graalvm@21)
Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995