Skip to content

Creating an easy handle polls file system every time for OpenSSL #362

Closed
@sagebind

Description

@sagebind

While doing some profiling of Isahc to see if I could squeeze any more performance out of it, I noticed that creating new easy handles was spending a noticeable amount of time in openssl_probe::probe. Not an egregious amount of time, mind you, but enough to be noticeable. Digging deeper I saw that this function allocates a fair number of PathBufs and makes std::fs::metadata calls to look for certificate files.

It is probably unlikely for these files to be changed at runtime, and if they do, I don't think most people would expect a running program to immediately pick up the change. Therefore I suggest that we lazily probe for certs just once, and re-use the results for subsequent easy handles created. Or at the very least, allow the user to opt-out of scanning for certs for every easy handle created.

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