Skip to content
This repository was archived by the owner on Oct 18, 2022. It is now read-only.
This repository was archived by the owner on Oct 18, 2022. It is now read-only.

Very slow download #77

Open
Open
@cschramm

Description

@cschramm

xml-rs is freaking slow so that it slows down download rates for any connection with more than like 1 MBit/s (even locally!).

I successfully worked around that by implementing and using a Transport wrapper that just adds buffering to the stream:

struct BufTransport {
    inner: RequestBuilder,
}

impl Transport for BufTransport {
    type Stream = BufReader<<RequestBuilder as Transport>::Stream>;

    fn transmit(self, request: &Request<'_>) -> Result<Self::Stream, Box<dyn Error + Send + Sync>> {
        self.inner.transmit(request).map(BufReader::new)
    }
}

(RequestBuilder could be a generic Read of course)

As long as xml-rpc-rs sticks with xml-rs, I guess it's a good idea to use a BufReader in general. I can prepare a pull request if you like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions