hanabi1224 / Programming-Language-Benchmarks

Yet another implementation of computer language benchmarks game
https://programming-language-benchmarks.vercel.app/
MIT License
650 stars 133 forks source link

Unfair comparison of HTTPS (Go) vs HTTP (RUST) performance #331

Open maxsharabayko opened 1 year ago

maxsharabayko commented 1 year ago

Seems like the Golang version of the HTTP-server problem (1-http2.go) spawns an HTTPS server (with TLS encryption), while the RUST version (1.rs) spawns a regular HTTP server (without encryption). Hence the performance comparison is not fair.

lohaswinner commented 1 year ago

@hanabi1224

There is 1.go. https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/main/bench/algorithm/http-server/1.go

Why isn't it on the web?

lohaswinner commented 1 year ago

@hanabi1224 Oh~ sorry. There is 1.go. But the representation is displayed by '1-m.go'. I can't understand the layout translation.

@maxsharabayko There are HTTP-server 1.go. and HTTPS-server 1-http2.rs. Though I can't understand well why HTTPS server by Golang is the fastest of the Input: 500, it's just a case of implementation by Golang. Maybe, Golang uses the feature of HTTPS acceleration. (e.g. 0-RTT session resumption)

hanabi1224 commented 1 year ago

Though I can't understand well why HTTPS server by Golang is the fastest

It's http2 being faster not https.

Side note: http2 requires https in general, http2 over tcp aka h2c is not widely used or impelemented

Seems like the Golang version of the HTTP-server problem (1-http2.go) spawns an HTTPS server (with TLS encryption), while the RUST version (1.rs) spawns a regular HTTP server (without encryption).

http protocols are part of file name, why would you compare rust http/1.1 with go http/2?

maxsharabayko commented 1 year ago

http protocols are part of file name, why would you compare rust http/1.1 with go http/2?

I was confused by the results on this page then: https://programming-language-benchmarks.vercel.app/problem/http-server Didn't think the problems being solved and presented in the same table are different. Maybe worth separating HTTP1 and HTTP2 results or adding a tag?

maxsharabayko commented 1 year ago

BTW is there a problem statement for this test? I was thinking to add C++ implementation. I wonder do I need the whole HTTP server (e.g. boost.beast) or simple HTTP request/response would be enough (then simply boost.asio).

cyrusmsk commented 1 year ago

Some clarifications, restrictions and details about problem are required. Also not very clear why some solutions have "-m" and other have not.