Skip to content

In bbcache switch from reqwest to ureq #213

@nsheff

Description

@nsheff

Consider switching from reqwest to ureq in gtars-bbcache

Background

  • gtars-bbcache currently uses reqwest for HTTP requests to download BED files from bedbase.org.

  • related to Python bindings wont build for linux aarch64 #18

    Problem

    reqwest is a heavy dependency:

    • Pulls in 161 packages (including tokio, hyper, TLS libraries, etc.)
    • Even with features = ["blocking"], it still uses tokio/async internally
    • Increases compile times significantly
    • Adds unnecessary complexity for our simple use case (just GET requests)

    Proposed Solution

    Switch to ureq:

    • Only 70 packages (less than half of reqwest)
    • Synchronous-only (no async runtime overhead)
    • Faster compile times
    • Still supports HTTPS, error handling, and all features we need

    Impact

    • Reduced dependency tree
    • Faster builds
    • No functional changes (API is similar)
    • Same HTTPS/TLS support

    Code Change

    [dependencies]
    -reqwest = { version = "0.12.15", features = ["blocking"] }
    +ureq = "2.10"
    
    Update HTTP calls from:
    let response = reqwest::blocking::get(&url)?.bytes()?.to_vec();
    
    To:
    let mut data = Vec::new();
    ureq::get(&url).call()?.into_reader().read_to_end(&mut data)?;
    
    

other options:

Library Total Packages Downloads (all-time) Recent Downloads Notes
reqwest 161 267M 45M Most popular, but heavy
ureq 70 63M 11M Popular & well-maintained
attohttpc 98 15M 2.2M Moderate popularity
minreq 25 2.9M - Lightest, less popular

Analysis:

  • reqwest is 4× more popular than ureq, but 6× heavier (161 vs 70 packages)
  • ureq has good popularity (63M downloads) with half the dependencies
  • minreq has lowest downloads but is the simplest (25 packages)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions