Replies: 3 comments 3 replies
-
Thanks for trying out Isahc, always appreciate feedback!
Well
Hyper is pretty darn fast so I'm pretty pleased to see Isahc being at least within the same ballpark performance as Hyper! Generally Isahc has weaker throughput with lots of concurrent requests since That said, I do have a couple notes on your PR where there's probably some performance being left on the table: fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let mut data = vec![0; 1024];
match ready!(Pin::new(&mut self.body).poll_read(cx, &mut data)) {
Ok(0) => Poll::Ready(Error::new( This is allocating a buffer every time the response stream is polled, which is pretty inefficient. It would be better to allocate a buffer once and reuse the buffer every call. Also, 1 KiB is a pretty small buffer which will probably lower throughput; Isahc streams are internally buffered at 64 KiB so using a buffer closer to that size might yield better throughput. Also, I'm not sure if the project has any additional buffering layers higher up in the stack but generally we recommend using the response streams directly if possible since they are pre-buffered, and additional buffering layers can also reduce throughput. Edit: Based on another pass I think you could simply read into Overall looks pretty correct to me. |
Beta Was this translation helpful? Give feedback.
-
Hey @Xuanwo, did you end up switching to isahc? |
Beta Was this translation helpful? Give feedback.
-
Updates: OpenDAL decides to use We do want the blocking API support, and implementing that against hyper is boring and easy to go wrong with nest tokio runtime. Compared to that, the slight performance difference can be ignored. Contributors from OpenDAL can also make some contributions to improving the overall performance! |
Beta Was this translation helpful? Give feedback.
-
Hi, there!
OpenDAL is a rust library that focuses on accessing different storage services painless and efficiently. I worked out a demo to migrate
hyper
toisahc
. Here is my conclusion to share with theisahc
community, hoping it will be helpful!apache/opendal#471
I have mainly two questions:
'static
ResponseFuture?isahc
in the wrong way?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions