Skip to content

http client benchmarks#328

Merged
fwbrasil merged 1 commit intomainfrom
http-client-bench
May 6, 2024
Merged

http client benchmarks#328
fwbrasil merged 1 commit intomainfrom
http-client-bench

Conversation

@fwbrasil
Copy link
Copy Markdown
Collaborator

@fwbrasil fwbrasil commented May 6, 2024

I'm working on the performance of Requests. I couldn't find a way to instantiate zio-http's client once and reuse it so I've disabled the benchmark for ZIO by returning a constant. Please ignore ZIO's results for now.

image

@hearnadam
Copy link
Copy Markdown
Collaborator

I think for ZIO applications you will need to add a method which enables creating runtimes from layers (I think some of the framework is already there for the scheduler change)

You should be able to do

val clientRuntime: Runtime[Client] = unsafeRun(Runtime.default)(Client.default.toRuntime)


val zioUrl =
import zio.http.*
URL.decode(this.url).toOption.get
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do you need the this prefix?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, it conflicts with zio.http.url

@fwbrasil
Copy link
Copy Markdown
Collaborator Author

fwbrasil commented May 6, 2024

I'm merging this to follow up with optimizations. I'll open a ticket for ZIO's benchmark.

val clientRuntime: Runtime[Client] = unsafeRun(Runtime.default)(Client.default.toRuntime)

Wouldn't that still initialize the client on each benchmark execution? I think we need to get a hold of a client instance to reuse across executions.

@fwbrasil fwbrasil merged commit b0cbf0b into main May 6, 2024
@fwbrasil fwbrasil deleted the http-client-bench branch May 6, 2024 23:10
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.

2 participants