HVM icon indicating copy to clipboard operation
HVM copied to clipboard

Feedback on reqwest dependency

Open jart opened this issue 3 years ago • 3 comments

Hey HVM authors. Awesome project. We've been porting it to Cosmopolitan Libc so it can run as an Actually Portable Executable.

I'm writing to bring to your attention that the only difficulties we encountered were due to a dependency on the "reqwest" library, which depends on non-portable i/o interfaces and schleps in 60 dependencies. We were able to successfully work around this on our end (see our fork in https://github.com/ahgamut/HVM/tree/cosmopolitan) so we require no action on your part, but I'd suggest that the dependency be reconsidered regardless, since it's only needed by this project on a single line that performs a simple HTTP GET request. Perhaps something more standard and leaner?

Thanks for the great work!

cc: @ahgamut

jart avatar Oct 02 '22 09:10 jart

Hey HVM authors. Awesome project. We've been porting it to Cosmopolitan Libc so it can run as an Actually Portable Executable.

I'm writing to bring to your attention that the only difficulties we encountered were due to a dependency on the "reqwest" library, which depends on non-portable i/o interfaces and schleps in 60 dependencies. We were able to successfully work around this on our end (see our fork in ahgamut/HVM@cosmopolitan) so we require no action on your part, but I'd suggest that the dependency be reconsidered regardless, since it's only needed by this project on a single line that performs a simple HTTP GET request. Perhaps something more standard and leaner?

Thanks for the great work!

cc: @ahgamut

nice, any other comments etc? I am actually using redbean for a new service, so interested in the potential applications!

sambacha avatar Oct 08 '22 05:10 sambacha

Yes, it is only used on run_io. The problem is, run_io will probably include other non-portable interfaces due to its very nature. Perhaps a more sensible approach would be to just add a pragma to exclude run_io from portable executables? It wouldn't work anyway.

VictorTaelin avatar Oct 10 '22 18:10 VictorTaelin

Regardless of the portability issues, I recommend merging in the patch from https://github.com/ahgamut/HVM/tree/cosmopolitan, since it makes cargo build about 3x faster on my machine.

Benchmarks

I ran these 3 times each, interleaved, to reduce random error.

HVM master

work@ub:~/beta/HVM$ time (cargo clean && cargo build 2>/dev/null)

real	1m13,181s
user	3m40,239s
sys	0m17,160s
work@ub:~/beta/HVM$ time (cargo clean && cargo build 2>/dev/null)

real	1m18,195s
user	3m47,138s
sys	0m17,900s
work@ub:~/beta/HVM$ time (cargo clean && cargo build 2>/dev/null)
                              
real	1m25,026s
user	3m45,692s
sys	0m18,458s
work@ub:~/beta/HVM$ git rev-parse HEAD
71dd90684fe7d7acf21828428795b4689a639b34

Patch at https://github.com/ahgamut/HVM/tree/cosmopolitan

work@ub:~/beta/tmp/HVM$ time (cargo clean && cargo build 2>/dev/null)

real	0m38,791s
user	1m57,686s
sys	0m8,490s
work@ub:~/beta/tmp/HVM$ time (cargo clean && cargo build 2>/dev/null)

real	0m45,095s
user	1m56,095s
sys	0m8,656s
work@ub:~/beta/tmp/HVM$ time (cargo clean && cargo build 2>/dev/null)

real	0m43,731s
user	1m58,950s
sys	0m8,588s
work@ub:~/beta/tmp/HVM$ git rev-parse HEAD
f25cb04f27616163fe6a1be8acfc8e4fa521b754

lawcho avatar Oct 12 '22 08:10 lawcho

I'll have a look, but I'm in the middle of a big refactor and polish right now

VictorTaelin avatar Oct 24 '22 21:10 VictorTaelin

The changes are here. I'll have a look on @lawcho's suggestion soon.

VictorTaelin avatar Nov 14 '22 03:11 VictorTaelin